0 Replies Latest reply on Jan 29, 2013 6:38 PM by BreakawayPaul

    <cfimage> has problem with certain photos

    BreakawayPaul Level 2

      I recently built a photo album for my website, and now that it's up and running, I'm running into problems uploading files.

       

      My album works like this:

       

      First, I use ImageMagick's "mogrify -resize" command to cut the originals down to 1280 width.  I don't need the pics any larger than this, so this cuts down on uploading time.

       

      Second, I FTP the pics to an "uploads" directory on my server (that's pw-protected on the browser side).

       

      Three, I log in to the uploads page, and a <cfdirectory> tells me how many pics there are.  I select an album, and click "submit".

       

      This submits to a page that does a few things:

      1. it makes sure the file is not wider than 1280px in either dimension, and resizes it if it is.
      2. it copies that original to a /fullsize/ folder.
      3. it uses cfimage to make a thumbnail (180px width) and places it in a /thumbnails/ folder
      4. it uses cfimage again to make the main viewing pic (800px width), and places it in the main gallery folder
      5. It runs a <cfquery> to add the pic to a database with the proper album id
      6. finally, it uses <cffiile> to delete the original from the uploads folder.

       

      I used this to upload over 4,000 pics locally on my Linux machine during development before copying the db and pics to my server.  I've also uploaded several more pics since the gallery has been "live".

       

      My problem is that (both on live and local) is that sometimes it "stalls" and refuses to process pics.  It throws NO errors of any kind, so I have NO idea what's going on.  It just *stops*. 

       

      I've checked permissions, renamed files (the file name column in my photos table doesn't allow duplicates, for obvious reasons).  Right now, there are only two things that the files that the script stalls on have in common.

      1. I've used ImageMagick to resize them locally
      2. They are always portrait oriented pics.  If I have 30 pics I'm uploading, it'll stall on the first one that's portrait.

       

      Now, if I open the pic in the default viewing app on my machine (Gnome Image Viewer) and rotate the pic 90 degrees to the right, then 90 back to the left and save it, this "fixes" it and it'll upload with no issues.

       

      I know this is a pretty one-off sounding, off in left field problem, but I figured I'd toss it out there in case there's a known issue.

       

      I can post the code of my processing page, but it obviously works since I've uploaded 4000+ pics with it.  It's clearly a file problem, but I have no idea what could be wrong.  Any ideas?