htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Add-Ons:
Help! automatic image upload.


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Acidjunkie
Novice

Apr 16, 2004, 4:30 AM

Post #1 of 12 (34439 views)
Shortcut
Help! automatic image upload. Can't Post

Hi I had an idea for this app. I want to be able to cut information out of my ocr package and paste the text and images into htmlArea for uploading both the text and images into a database, in the same format that the original was formatted, ie a magazine article, problem is the images are all stored locally and need to be stored in the database with the article so i can search the text and then bring the whole article with the pictures to be displayed as it was orginally printed.
Does anybody have any ideas as to how I could get it to automatically upload all images displayed in the htmlArea app. Thanks in advance, andrew


Crirus
Novice

Apr 16, 2004, 6:25 AM

Post #2 of 12 (34413 views)
Shortcut
Re: [Acidjunkie] Help! automatic image upload. [In reply to] Can't Post

You should look for an older and modified version of htmlarea. 2.03 have animage maanger that allow you to upload images to server, then link to document from there



regards


Acidjunkie
Novice

Apr 17, 2004, 3:29 AM

Post #3 of 12 (34373 views)
Shortcut
Re: [Crirus] Help! automatic image upload. [In reply to] Can't Post

Thanks for the reply Crirus, but that wont help me you see my users are all retards, and asking them to format each page will not work, I was thinking of a script that would scan the html sent by htmlarea, and exract the img tags and upload the images as a blob, and then replace the src tag with the img id in my database. Any ideas? I am a bit worried about using the instr command because the chances of all the img tags being formated the same are quite slim, also if I scan the html for the src tag it will probably save all the possible hyperlinks in the document as well as any other tag with src in it.

I have got a copy of both 3 and 2.03 but I cant find the image manager


Crirus
Novice

Apr 17, 2004, 5:40 AM

Post #4 of 12 (34367 views)
Shortcut
Re: [Acidjunkie] Help! automatic image upload. [In reply to] Can't Post

this is a good one
Attachments: htmlarea203_wei_11_09_2003.zip (130 KB)


kimss
User

Apr 17, 2004, 5:54 AM

Post #5 of 12 (34361 views)
Shortcut
Re: [Acidjunkie] Help! automatic image upload. [In reply to] Can't Post


Quote
Thanks for the reply Crirus, but that wont help me you see my users are all retards

LOL, Nice honest opinion of the typical end-user. True true.

Kim Steinhaug
kim-at-steinhaug-dot-com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Norwegian office : +47 88 00 92 45, Swedish office : +46 31 704 43 40
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Acidjunkie
Novice

Apr 17, 2004, 6:19 AM

Post #6 of 12 (34362 views)
Shortcut
Re: [Crirus] Help! automatic image upload. [In reply to] Can't Post

Hi Crirus, thanks for that the php verison is cool, but it wont help, I dont want my users having to upload or insert the images, have a look at http://5lakes.no-ip.com/default.htm thats what the info they are going to upload will look like, select all and paste into htmlarea, then I want to have an upload button to upload the lot with images into my database one shot, I think you will see my problem now.


Acidjunkie
Novice

Apr 17, 2004, 6:21 AM

Post #7 of 12 (34356 views)
Shortcut
Re: [kimss] Help! automatic image upload. [In reply to] Can't Post

I thought so.. any ideas for my problem?


kimss
User

Apr 17, 2004, 6:56 AM

Post #8 of 12 (34349 views)
Shortcut
Re: [Acidjunkie] Help! automatic image upload. [In reply to] Can't Post

Hello, I just did a test, inserted an image into a word file - selected the picture, copy and paste into the V3 area. I would expect a single IMG tag, but instead one single image results in this bloated code :


Code
  <span style="FONT-SIZE: 12pt; FONT-FAMILY: "Times New Roman";  
mso-fareast-font-family: "Times New Roman"; mso-ansi-language: EN-US;
mso-fareast-language: EN-US; mso-bidi-language: AR-SA">
<shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe"
o:preferrelative="t" o:spt="75" coordsize="21600,21600">
<font color="#000000"> <stroke joinstyle="miter" />
</font><formulas><f eqn="if lineDrawn pixelLineWidth 0" />
<f eqn="sum @0 1 0" /><f eqn="sum 0 0 @1" /><f eqn="prod @2 1 2" />
<f eqn="prod @3 21600 pixelWidth" /><f eqn="prod @3 21600 pixelHeight" />
<f eqn="sum @0 0 1" /><f eqn="prod @6 1 2" /><f eqn="prod @7 21600 pixelWidth" />
<f eqn="sum @8 21600 0" /><f eqn="prod @7 21600 pixelHeight" />
<f eqn="sum @10 21600 0" /></formulas>
<path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f" />
<lock aspectratio="t" v:ext="edit" /></shapetype>
<shape id="_x0000_i1025" style="WIDTH: 150pt; HEIGHT: 201.75pt"
type="#_x0000_t75"><imagedata o:title="PIC00046"
src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\03\clip_image001.jpg" />
</shape></span>



Looking at this code and past experience your function should be highly duable to complete, you would however get a barrier with the default 2MB upload limit on most system. Remember that many pictures inserted into Word arnt web optimized but are iften large images. This would atleast in theory be a problem. However, generating a batch system to upload one and one image to the entire set of images is uploaded would fix this aslong as no images are above 2MB. Then there would need to be an installation of ImageMagick on the server so that we can generate 1:1 72DPI thumbnails / representations of the uploaded images, the original images could be saved for a print version if needed.

And - When this is done you would also need to combine this with some sort of HtmlTidy system, to clean up the Word code which the above example explains.

To cut it short - I think this function is duable. On the other hand I can help you out since this function is not on my priority list. I also think there will be alot of work for this function to be developed, so if you were to hire a developer you should be ready for this. A good function - but abit tricky and timeconsuming if you are to make it for dummies. As you mentioned above - retard users - they will need a system that works 99% percent and all pitfalls should be accounted for before they happens.

Maby some other people have the spare time to complete this function. From the V2 forum I noticed a user from Russia, Boris, who has created a PHP function to strip Wordcode, "Refine". This function looks promising, its however lisenced, but again - looks very promising - and in my opinion thats what counts.

Kim Steinhaug
kim-at-steinhaug-dot-com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Norwegian office : +47 88 00 92 45, Swedish office : +46 31 704 43 40
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


(This post was edited by kimss on Apr 17, 2004, 11:06 AM)


Acidjunkie
Novice

Apr 17, 2004, 9:06 AM

Post #9 of 12 (34347 views)
Shortcut
Re: [kimss] Help! automatic image upload. [In reply to] Can't Post

Hi kimss, thanks for the input, as for you comment on the size problem, i see that the guys who built aspSmartUpload have also build a plugin that resizes images before you upload them so that they meet your requirements, quite a nifty little tool.

Have you started using .net yet, I have just started and found a great pieace of code about 10 lines long that automatically draws a gif img out of any text that you write in a text box, it does all this without making any api calls, or calling or registering any .dll, i was searouly impressed, I think that i would be able to use this some how with this application. also I saw you where reading the img tag from a word doc, the stuff my users are going to be uploading will already be in standard html copied from ie5.

But obviuosly some users will want to do things thier way, i had over looked the possibilty of them using word, did you have a look at the example of an article at http://5lakes-no-ip.com/default.htm?. as you can see the for each image look something like this


Code
 <img src="tmp64-1.jpg" alt="tmp64-1.jpg" style=" width:338.40pt; height:167.04pt;">



the problem is the src tag doesn't give the whole path "tmp64-1.jpg" I need to find out what the path is then I suppose send the html sent from the textarea to another processing section to replace the src tags with the path in my database.

I know this might seem all over the place but I am trying.

Shot



kimss
User

Apr 17, 2004, 11:26 AM

Post #10 of 12 (34343 views)
Shortcut
Re: [Acidjunkie] Help! automatic image upload. [In reply to] Can't Post

Working with normal HTML kode is ofcourse alot easier since we dont need to tidy it. The other problem as you mention are when pasting code from other webpages, since the domain name and such arnt brought along. No need in creating this to only work with HTTP paste, the first thing people will ask for is WORD paste. If you made the WORD paste they will ask for HTTP paste...

Well a simple (I cant think of other sollutions either) sollution would be when pasting content from the web, you also need to paste the url you copied from. This way the script can use the given path, parse the IMG tags and fix all paths.

Resizing images before uploading sounds really cool, but the size of the project doesnt get any smaller by adding this function, :)

This system would in my opinion work this way :
1. Paste the contents
2. Paste the URL of where the contents came from
3. Parse the content and fix all the IMG tags, alot of pitfalls here.
4. Parse the content for CSS and JS functions that might be needed for the content.
5. Create a list of files which needs to be fetched(web) / uploaded (word)
6. Upload all images, best way one by one to avoid 2MB limit. If fetching size doesnt matter. Also, one could develop a JavaApplet which in turn could check filesizes (local files).
7. Optimize images if needed for fast webview, (regarding the upload images, fetched images are already this)
8. Store images in webserver directories
9. Parse HTML and assign new IMG attributes, CSS styles and optional JS functions.
10. If WORD clean up code

This isnt a walk in the park, and there are atleast a 100 pitfalls along the road here. Maby someone will do it and give it away for free - i doubt it, but one never knows, :)

A yet simpler system could be to create a parsing system for every submit of the HTMLArea. This, when I think of it, sounds like a really smart idea. Whenever you submit a HTMLArea you physically parse all the IMG tags and validate that the images exists. If they dont exist you serve the user a page where he can point to where the images might be, and you try again. Here they can paste the path they copied from. If on the other hand the images arnt found - we simpy delete them.

This sounds to me like a great feature, since nobody really want broken images anyway.

huh - the more I think of this system the more complicated it sounds (and gets)...

Kim Steinhaug
kim-at-steinhaug-dot-com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Norwegian office : +47 88 00 92 45, Swedish office : +46 31 704 43 40
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Acidjunkie
Novice

Apr 17, 2004, 1:57 PM

Post #11 of 12 (34337 views)
Shortcut
Re: [kimss] Help! automatic image upload. [In reply to] Can't Post

Hi Kimss,

I was planning on doing it they way you suggest in your second idea, but yes I felt the same way the more you try to think about putting it together, the more problems you hit, but anyways i'll sleep on it and see if i cant come up with a plan, will let you know shot for the help so far see what you can do, its always a bit of a suck, thinking it through without a bit of help. it would be nice if we could develop this thing and make it work 100%, i see a lot of uses for it.

till tommorow then, its late and my brain is fried!!


loudude
New User

Jul 10, 2004, 8:11 PM

Post #12 of 12 (33452 views)
Shortcut
Re: [Acidjunkie] Help! automatic image upload. [In reply to] Can't Post

this would be a great idea !

i love the suggestion to parse img tags and try to get file , then onerror popup the image manager to edit that tag ... that would work great when using HTMLarea for 'new-from-scratch' and maybe even more useful when editing 'old' messages with pre-existing img tags that are no-longer valid ... an auto-link checker ... maybe extend that function to check any link?

BUT if you use in a 'OCR' context ; the user would scan and ocr an image on his local machine , then save the results to a 'new directory' in HTML format ... this would happen before he opens up HTMLarea .... then when he opens HTMLarea to upload the ocr'd results , he would use the 'file manager' panel , in that panel you could have a similar 'parse for includes' button that would auto-attach files , could use the individual 'img src' values for graphics , would also need to search through tags for css and js ... also would need to auto-append as many 'file' upload fields as you need for all attachments AND need to maintain their relative location at server ... like if you use this to upload a webpage that was saved as 'web page complete' in IE that would have created at least one or maybe a whole bunch of nested folders for all the images and scripts .... then you would need to re-create that folder structure on your server .....

that's a lot of code ... maybe the simplest solution would be to 'save as pdf' your ocr results... then upload that file ... sorry but that is a lot easier eh ?!

that 'easy way out' would require a 'new' button in HTMLarea editor so you can 'include' that file inside a webpage : iFrame to display external urls , like a pdf file....

maybe the easy way isn't such a bad idea? ... since not 'all' browsers like iFrames that button would need to generate a bit of javascript to browser-sniff and open new window if neccessary....

it would be an added feature for HTMLarea and you would service your 'ocr chalenged' clients...

if anyone wants to collaborate on either , let me know ... i love htmlArea !!

my two-bits

LouCharrierMIS@go.com

 
 
 


Search for (options)