Question
Image Resize
I am using cfscript tag to write code that resizes an image
and writes it on a certain folder. See code below.
<cfscript>
myImage = ImageNew(ExpandPath(cover_url));
ImageResize(myImage,"100","","lanczos");
ImageWrite(myImage,'#ExpandPath(thumb)#/#ListLast(cover_url,"/")#');
</cfscript>
I am not so sure how I can check if the resized photo already exist, before resizing it again. If it exist, I'd like to rename the new file name so it is unique or just don't overwrite the resized copy at all.
Thanks,
Ngu
<cfscript>
myImage = ImageNew(ExpandPath(cover_url));
ImageResize(myImage,"100","","lanczos");
ImageWrite(myImage,'#ExpandPath(thumb)#/#ListLast(cover_url,"/")#');
</cfscript>
I am not so sure how I can check if the resized photo already exist, before resizing it again. If it exist, I'd like to rename the new file name so it is unique or just don't overwrite the resized copy at all.
Thanks,
Ngu
