EasyCFM.COM ColdFusion Forums / ColdFusion Applications / cfx_image error reading pjpeg files

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: cfx_image error reading pjpeg files

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

bighugemat
06-25-2007 @ 7:51 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 2
Joined: Jun 2007

I am using CFFILE to allow users to upload a photo.  I have to ACCEPT image/pjpeg files because that sems to be the default mime type for photos captured with a digital camera.  However, the second I use a CFX_IMAGE tag to manipulate that uploaded file, cold fusion throws an error: "... not a valid image file".  The same code works perfectly well for all other images.  Is there a fix?  A workaround?  Anything?

bighugemat
06-27-2007 @ 2:53 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 2
Joined: Jun 2007

I figured out that by using CFX_IMAGE2 alongside CFX_IMAGE to handle PJPEG file types, it works great.  

So I just use <CFX_IMAGE2 ACTION="READ" FILE="C:\Domains\mydomain\images\filename.jpg"> to read any type of uploaded photo...

...and then IF the photo width is too large I use <CFX_IMAGE2 ACTION="RESIZE" FILE="C:\Domains\mydomain\images\filename.jpg" OUTPUT="C:\Domains\mydomain\images\filename.jpg" QUALITY="90" X="600">

ELSE IF the width is fine, then I use <CFX_IMAGE2 ACTION="CONVERT" FILE="C:\Domains\mydomain\images\filename.jpg" OUTPUT="C:\Domains\mydomain\images\filename.jpg" TYPE="JPEG" QUALITY="90"> to make sure that any PJPEG files are coverted to regular JPEG

After that I can continue to use any CFX_IMAGE tags I want and there will be no "not a valid image file" error thrown by Cold Fusion.



Website Designed and Developed by Pablo Varando.