RE: CF Image question...
I am doing a very similar thing. Folks put their thumbnails in a folder, and every night (free) software called Cobian Backup (http://www.educ.umu.se/~cobian/cobianbackup.htm) automatically uploads the new files via FTP. Using CF scheduler, the files are then read in by recursively going through the uploaded directories and adding the files and information to a database. Next I use image CFC to resize for thumbnails and for a watermarked image. I am using CFX_Watermark next to put in the watermark. (I wanted to use CFIMAGE, but I found it was too slow and wasn't getting through images fast enough--between 20 and 200 images get processed every night) Hope this helps... -Original Message- From: Dave l [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 26, 2007 12:35 AM To: CF-Talk Subject: Re: CF Image question... Right now I can do it 2 different ways.. one is to upload each one separately or I can ftp into the site and just upload the images then in the admin I can choose to upload one or run scripts if I have already uploaded them. If I have ftp'd them then it does run them 25 at a time, it starts with cfdirectory loop grabs the next images enters the info in db then makes the larger image and puts into into the large folder, then the thumnail and put it into the thumbs folder then moved that original image to a saved folder. I don't delete them at that point because I need to keep the original ones for downloading but the girl whos site is is then goes in and picks out the ones she wants and the rest get deleted and then the good ones zipped up and then the originals are deleted to save space. So to answer your ?.. it could but I guess it is just as easy to watermark them b4 hand. I run them through iwatermark and takes about 15 seconds to do 200 images but there are other sites where they may add a few pix a week where that would work. Could you use a recursive routine to process, say, 25 images, have a delay, then run the routine again on images that were not processed the first or preceding runs, allowing the server a chance to recover from each run until all images are processed? Rick ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295885 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF Image question...
The thing I wish it would do is add a permanent watermark on uploaded images instead of only on temp png while being shown. You can do this: 1. Read in original image 2. Read in watermark image (transparent GIF) 3. Set transparency of watermark image to 20-30% Either: 4. Mathematically locate position of watermark OR 4. Resize watermark image to size of original (in memory) THEN 5. Overlay watermark image on original image FINALLY 6. Rewrite original image to drive. This is something that can take the server some time to do - I would suggest using asynchronous processing or scheduled task to handle this. Hatton ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295333 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF Image question...
This is something that can take the server some time to do - I would suggest using asynchronous processing or scheduled task to handle this. We ran into some issues at my day job trying to use cfthread for resizing images, realizing that if you're doing a lot of it, you can run out of threads in the cfthread pool and the remaining cfthread tags will error out if they don't get access to a thread fast enough. So one alternative that would allow you to resize the images when the user uploads them (no scheduled task) without slowing them down would be to return content to the browser prior to your image editing, i.e. /body /html cfflush / cfimage ... / I do this occasionally in the onRequestEnd (function / template). The drawback is that you can't use cflocation after the cfflush tag to redirect the user if you're going to do that -- and at least with any recent version of ColdFusion you can't use cflocation before any code you want to execute. So if you wanted to redirect the user this way, you would want to use either a meta tag or javascript in the content before the cfflush tag. (and I would include a continue link also) Another alternative would be to use cfhttp / to spawn a request for a page in your application that performs the image manipulation without waiting for the http result content. I'm told there is a way to use cfhttp (a particular timeout value I think) in which ColdFusion doesn't wait for the response, although I haven't personally used it. This way you could span the http request and then redirect the browser with cflocation if you want. hth, ike -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 503.236.3691 http://onTap.riaforge.org ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295339 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF Image question...
I had thought about that but I figured the overhead was gunna be too much even though its all done on my ded box. If you are going to do just a few or one at a time then this would work but in my case there would be between 80-300 at a time which would be a killer. thanks tho! The thing I wish it would do is add a permanent watermark on uploaded images instead of only on temp png while being shown. You can do this: 1. Read in original image 2. Read in watermark image (transparent GIF) 3. Set transparency of watermark image to 20-30% Either: 4. Mathematically locate position of watermark OR 4. Resize watermark image to size of original (in memory) THEN 5. Overlay watermark image on original image FINALLY 6. Rewrite original image to drive. This is something that can take the server some time to do - I would suggest using asynchronous processing or scheduled task to handle this. Hatton ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295343 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF Image question...
Could you use a recursive routine to process, say, 25 images, have a delay, then run the routine again on images that were not processed the first or preceding runs, allowing the server a chance to recover from each run until all images are processed? Rick -Original Message- From: Dave l [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 25, 2007 4:32 PM To: CF-Talk Subject: Re: CF Image question... I had thought about that but I figured the overhead was gunna be too much even though its all done on my ded box. If you are going to do just a few or one at a time then this would work but in my case there would be between 80-300 at a time which would be a killer. thanks tho! The thing I wish it would do is add a permanent watermark on uploaded images instead of only on temp png while being shown. You can do this: 1. Read in original image 2. Read in watermark image (transparent GIF) 3. Set transparency of watermark image to 20-30% Either: 4. Mathematically locate position of watermark OR 4. Resize watermark image to size of original (in memory) THEN 5. Overlay watermark image on original image FINALLY 6. Rewrite original image to drive. This is something that can take the server some time to do - I would suggest using asynchronous processing or scheduled task to handle this. Hatton ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295348 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF Image question...
Right now I can do it 2 different ways.. one is to upload each one separately or I can ftp into the site and just upload the images then in the admin I can choose to upload one or run scripts if I have already uploaded them. If I have ftp'd them then it does run them 25 at a time, it starts with cfdirectory loop grabs the next images enters the info in db then makes the larger image and puts into into the large folder, then the thumnail and put it into the thumbs folder then moved that original image to a saved folder. I don't delete them at that point because I need to keep the original ones for downloading but the girl whos site is is then goes in and picks out the ones she wants and the rest get deleted and then the good ones zipped up and then the originals are deleted to save space. So to answer your ?.. it could but I guess it is just as easy to watermark them b4 hand. I run them through iwatermark and takes about 15 seconds to do 200 images but there are other sites where they may add a few pix a week where that would work. Could you use a recursive routine to process, say, 25 images, have a delay, then run the routine again on images that were not processed the first or preceding runs, allowing the server a chance to recover from each run until all images are processed? Rick ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295349 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF Image question...
I'd like to do something similar. In my case, drive space is limited. So, I'd really like to store the image once, but then control how it is displayed totally on the fly. I'd like 3 options.. 1) Display as thumbnail 2) Display full size for web 3) download original picture for printing I'm not super concerned about speed, I just hate all the manual processing and having to upload images into 3 directories (original, display, thumbnail) as I am doing now. Plus, I am rapidly running out of drive space. Any suggestions would be greatly appreciated. My photo directory (about a thousand pictures now) is falling behind because I have such a manual process now. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295324 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF Image question...
The thing I wish it would do is add a permanent watermark on uploaded images instead of only on temp png while being shown. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295331 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF Image question...
CFImage cannot read take a filefield like CFFile can (for upload)... However, CFImage source attribute CAN accept a binary blob type object. Theoretically, you can get this directly out of the FORM data without saving it to the system. If you forgo the CFFile upload portion, you MIGHT be able to grab the binary file value directly out out of the Request data. Now, I don't know how to do this :) I don't know how you parse a multipart form data object (which is what the request is at that point I think). However, I don't think all this overhead is worth it. You might as well just upload it, then use CFImage to resize and OVERWRITE the uploaded file. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Rick Faircloth [mailto:[EMAIL PROTECTED] Sent: Sunday, November 04, 2007 5:28 PM To: CF-Talk Subject: RE: CF Image question... I didn't know if there was some function that pulled the image into the server, then resized it, stored the resized file and deleted the original. I guess all this is possible with the various functions. I just didn't know if an intermediary step had been introduced to the typical cffile upload process. Rick ~| ColdFusion is delivering applications solutions at at top companies around the world in government. Find out how and where now http://www.adobe.com/cfusion/showcase/index.cfm?event=finderproductID=1522loc=en_us Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292645 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF Image question...
You might as well just upload it, then use CFImage to resize and OVERWRITE the uploaded file. I agree... that seems to be the best route. Nice to have the image tools, however. Rick -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 7:42 AM To: CF-Talk Subject: RE: CF Image question... CFImage cannot read take a filefield like CFFile can (for upload)... However, CFImage source attribute CAN accept a binary blob type object. Theoretically, you can get this directly out of the FORM data without saving it to the system. If you forgo the CFFile upload portion, you MIGHT be able to grab the binary file value directly out out of the Request data. Now, I don't know how to do this :) I don't know how you parse a multipart form data object (which is what the request is at that point I think). However, I don't think all this overhead is worth it. You might as well just upload it, then use CFImage to resize and OVERWRITE the uploaded file. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292647 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF Image question...
In my applications, I tend to upload the original into one directory and keep it there, then resize and drop the resized image into the directory where it will be normally accessed. While this would obviously not work in a case where the volume of unsized uploads would cause disk storage problems, I like it because it means that the original is at hand for me if there is some problem along the way... and, if some client calls and says, do you have that picture we uploaded, but we need the original, we lost it, I can produce it for them. Experience fine tunes paranoia, James On Nov 5, 2007 7:25 AM, Rick Faircloth [EMAIL PROTECTED] wrote: You might as well just upload it, then use CFImage to resize and OVERWRITE the uploaded file. I agree... that seems to be the best route. Nice to have the image tools, however. Rick -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 7:42 AM To: CF-Talk Subject: RE: CF Image question... CFImage cannot read take a filefield like CFFile can (for upload)... However, CFImage source attribute CAN accept a binary blob type object. Theoretically, you can get this directly out of the FORM data without saving it to the system. If you forgo the CFFile upload portion, you MIGHT be able to grab the binary file value directly out out of the Request data. Now, I don't know how to do this :) I don't know how you parse a multipart form data object (which is what the request is at that point I think). However, I don't think all this overhead is worth it. You might as well just upload it, then use CFImage to resize and OVERWRITE the uploaded file. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com ~| Enterprise web applications, build robust, secure scalable apps today - Try it now ColdFusion Today ColdFusion 8 beta - Build next generation apps Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292658 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CF Image question...
That's exactly the system of maintenance/use I had settled on, James. And, yes, it's gd to have the original that a client will ultimately need and not be able to find. ;o) I'm going to setup folder structures that will handle all the versions I will need for a site, such as: - Original - Width_400 - Width_100 Etc... whatever the site will call for. And I can add variations as I need to. And if space should ever become an issue, I can always burn the older orginals to a CD or backup to my FTP/Backup server on my network for archiving. It's going to be really nice to be able to upload a photo and have the versions created and deposited in their folders all at once by CF. It has be a *real pain* to have to teach clients how to resize a photo to 400 pixels and to not upload an original photo that would be displayed as a popup that was 2000 pixels wide! And then they wonder what's wrong with the website! Thanks for the tip. Rick -Original Message- From: James Edmunds [mailto:[EMAIL PROTECTED] Sent: Monday, November 05, 2007 10:54 AM To: CF-Talk Subject: Re: CF Image question... In my applications, I tend to upload the original into one directory and keep it there, then resize and drop the resized image into the directory where it will be normally accessed. While this would obviously not work in a case where the volume of unsized uploads would cause disk storage problems, I like it because it means that the original is at hand for me if there is some problem along the way... and, if some client calls and says, do you have that picture we uploaded, but we need the original, we lost it, I can produce it for them. Experience fine tunes paranoia, James ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292664 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF Image question...
Um, how would CF change an image that isn't on the server? It's server side technology. ;) (If I'm reading you wrong, let me know.) On Nov 4, 2007 3:45 PM, Rick Faircloth [EMAIL PROTECTED] wrote: I've been reading in the docs about the new image functions in CF 8, but I'm still not sure about whether or not I can resize an image as it's being loaded onto the server. I guess we still have to use cffile to get it on the server, then use the image tag/functions to manipulate the file *after* it's on the server? Rick ~| Check out the new features and enhancements in the latest product release - download the What's New PDF now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292632 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF Image question...
I didn't know if there was some function that pulled the image into the server, then resized it, stored the resized file and deleted the original. I guess all this is possible with the various functions. I just didn't know if an intermediary step had been introduced to the typical cffile upload process. Rick -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Sunday, November 04, 2007 5:00 PM To: CF-Talk Subject: Re: CF Image question... Um, how would CF change an image that isn't on the server? It's server side technology. ;) (If I'm reading you wrong, let me know.) On Nov 4, 2007 3:45 PM, Rick Faircloth [EMAIL PROTECTED] wrote: I've been reading in the docs about the new image functions in CF 8, but I'm still not sure about whether or not I can resize an image as it's being loaded onto the server. I guess we still have to use cffile to get it on the server, then use the image tag/functions to manipulate the file *after* it's on the server? Rick ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292633 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4