GR 1.5.1b8 Can't find jpegtran Mac OS X

rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Mon, 2006-01-02 23:53

When I go to upload to Gallery 2 from Gallery Remote 1.5.1b8 I get the message:

An optional part of Gallery Remote, jpegtran, could not be found or is malfunctioning. Gallery Remote will not be able to rotate images before uploading them.

I checked the package contents (Mac OS X version) and jpegtran is there. I also found a forum message about a similar problem in an older version of GR and a note that it would be fixed.

Could someone carefully explain a solution.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2006-01-03 09:54

Could you attach the GR log? Thanks.

--
Gallery Remote developer

 
rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Tue, 2006-01-03 20:50

Here is the log.

Many thanks.

AttachmentSize
GalleryRemoteLog.txt.txt98.41 KB
 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2006-01-04 06:44

This is the relevant part of the log:

 393281|TRACE|ImageUtils|Executing [Contents/MacOS/jpegtran, -copy, all, -rotate, 270, -outfile, /tmp/thumbs-bob/rot225910083.jpg, /tmp/thumbs-bob/tmp1026903420.jpg]
 393971|TRACE|ImageUtils|Err: Contents/MacOS/jpegtran: can't open /tmp/thumbs-bob/tmp1026903420.jpg
 393971|TRACE|ImageUtils|Returned with value 1

Somehow jpegtran isn't able to read that file. Can you try to find out why?

--
Gallery Remote developer

 
rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Thu, 2006-01-05 00:22

So, I can find the folder /tmp/thumbs (it is empty), but, I cannot find the folder /tmp/thumbs-bob/. Therefore, the temp files do not exist. I even checked using the terminal so I could see everything.

Could it have failed to create the folder in the first place and thus is unable to open it? I actually noticed the original message as soon as I tried to upload. I don't think it had even tried to do anything yet. From the log segment you selected, it seems that GR is finding jpegtran.

Thanks again.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2006-01-05 05:23

I don't think GR failed to create that directory: before using jpegtran, it was using IM to create thumbnails in that directory and succeeded. However, it does clean up after itself, which is why after GR shuts down you no longer have that directory.

--
Gallery Remote developer

 
rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Thu, 2006-01-05 07:58

So, is there a way to fix this. I just tried downloading a fresh version of the beta and then I tried the current release instead of the beta version. The current release does not even give the error message before trying to upload a photo that requires rotating. The last thing I tried is clearing the cache. Still no rotation.

Here is a segment of the log:

1963169|TRACE|GalComm2 |Overriding form data: [HTTPClient.NVPair[name=g2_form[cmd],value=add-item], HTTPClient.NVPair[name=g2_form[protocol_version],value=2.3], HTTPClient.NVPair[name=g2_form[set_albumName],value=101], HTTPClient.NVPair[name=g2_form[caption],value=, encoding=UTF-8], HTTPClient.NVPair[name=g2_form[force_filename],value=DSC_2892.JPG], HTTPClient.NVPair[name=g2_form[auto_rotate],value=no], HTTPClient.NVPair[name=g2_controller,value=remote.GalleryRemote]]
1963338|TRACE|StatusBar |level: 0 - Selected 2 pictures / 2,973 K - 0
1964015|TRACE|GalComm2 |Connecting to: http://localhost/gallery/main.php
1964015|TRACE|GalComm2 |Path: /gallery/main.php
1964018|TRACE|GalComm |Sending cookie: GALLERYSID=18267ad705f0c4b169758f02d73edd90; expires=Sun Dec 29 23:25:40 PST 2030; path=/gallery/; domain=.localhost.local
1989572|TRACE|GalComm2 |#__GR2PROTO__
status=0
status_text=Add photo successful.
debug_user=admin
1989574|INFO |GalComm2 |Upload successful
1989574|TRACE|MainFrame |Contents changed: javax.swing.event.ListDataEvent[type=2,index0=0,index1=0]
1989574|TRACE|MainFrame |updatePicturesList: current album: Canyon Heights Church 2005 (1)
1989575|TRACE|ThumbCache|preloadThumbnailFirst DSC_2891.JPG
1989617|INFO |GalComm2 |Will upload using UTF-8 for text data
1989617|INFO |GalComm2 |Preparing to upload...
1989617|TRACE|GalComm2 |add-item parameters: [HTTPClient.NVPair[name=cmd,value=add-item], HTTPClient.NVPair[name=protocol_version,value=2.3], HTTPClient.NVPair[name=set_albumName,value=101], HTTPClient.NVPair[name=caption,value=, encoding=UTF-8], HTTPClient.NVPair[name=force_filename,value=DSC_2891.JPG], HTTPClient.NVPair[name=auto_rotate,value=no]]
1989617|ERROR|Picture |Couldn't use jpegtran to resize the image, it will be uploaded unrotated
1989618|ERROR|Picture |java.lang.UnsupportedOperationException: jpegtran must be installed for this operation
at com.gallery.GalleryRemote.util.ImageUtils.rotate(ImageUtils.java:471)
at com.gallery.GalleryRemote.model.Picture.getUploadSource(Picture.java:221)
at com.gallery.GalleryRemote.GalleryComm2$UploadTask.uploadPicture(GalleryComm2.java:568)
at com.gallery.GalleryRemote.GalleryComm2$UploadTask.runTask(GalleryComm2.java:486)
at com.gallery.GalleryRemote.GalleryComm2$GalleryTask.run(GalleryComm2.java:294)
at java.lang.Thread.run(Thread.java:552)

1989618|TRACE|GalComm2 |Overriding form data: [HTTPClient.NVPair[name=g2_form[cmd],value=add-item], HTTPClient.NVPair[name=g2_form[protocol_version],value=2.3], HTTPClient.NVPair[name=g2_form[set_albumName],value=101], HTTPClient.NVPair[name=g2_form[caption],value=, encoding=UTF-8], HTTPClient.NVPair[name=g2_form[force_filename],value=DSC_2891.JPG], HTTPClient.NVPair[name=g2_form[auto_rotate],value=no], HTTPClient.NVPair[name=g2_controller,value=remote.GalleryRemote]]
1989928|TRACE|PreviewFra|Cache miss: DSC_2891.JPG
1989928|TRACE|PreviewFra|loadPreview DSC_2891.JPG
1989928|TRACE|PreviewFra|Calling Start
1989929|TRACE|PreviewFra|Starting DSC_2891.JPG
1989930|TRACE|ImageUtils|Executing [/usr/local/bin/convert, -filter, Lanczos, /Volumes/EdgeFiles/webEdgeFiles/Gallery/GalleryUploads/Private/CHCA/Canyon Fest/DSC_2891.JPG, -resize, 500x628, +profile, *, /tmp/thumbs/thumb598588712.jpg]
1990337|TRACE|StatusBar |level: 0 - Selected 1 picture / 1,435 K - 0
1990515|TRACE|StatusBar |level: 0 - Selected 1 picture / 1,435 K - 0
1990814|TRACE|GalComm2 |Connecting to: http://localhost/gallery/main.php
1990814|TRACE|GalComm2 |Path: /gallery/main.php
1990817|TRACE|GalComm |Sending cookie: GALLERYSID=18267ad705f0c4b169758f02d73edd90; expires=Sun Dec 29 23:25:40 PST 2030; path=/gallery/; domain=.localhost.local
2028438|TRACE|GalComm2 |#__GR2PROTO__
status=0
status_text=Add photo successful.
debug_user=admin
2028440|INFO |GalComm2 |Upload successful
2028447|TRACE|MainFrame |Contents changed: javax.swing.event.ListDataEvent[type=2,index0=0,index1=0]
2028447|TRACE|MainFrame |updatePicturesList: current album: Canyon Heights Church 2005
2029930|TRACE|PreviewFra|Cache miss: DSC_2892.JPG
2029930|TRACE|PreviewFra|loadPreview DSC_2892.JPG
2029930|TRACE|ThumbCache|preloadThumbnails
2029931|TRACE|ThumbCache|Calling Start
2029935|TRACE|StatusBar |level: 2 - Loading thumbnails - 0
2029936|TRACE|StatusBar |level: 0 - Thumbnails loaded - 0
2030140|TRACE|StatusBar |level: 0 - No selection - 0
2030230|TRACE|StatusBar |level: 0 - No selection - 0
2030259|TRACE|StatusBar |level: 0 - No selection - 0
2053069|TRACE|ImageUtils|Returned with value 0
2053637|TRACE|ImageUtils|Time: 63708 - Avg: 39726
2053637|TRACE|PreviewFra|Adding to cache: DSC_2891.JPG
2053637|TRACE|PreviewFra|touch DSC_2891.JPG
2055155|TRACE|ImageUtils|Time: 1517 - Avg: 37715
2055155|TRACE|PreviewFra|Adding to cache: DSC_2892.JPG
2055155|TRACE|PreviewFra|touch DSC_2892.JPG
2055156|TRACE|PreviewFra|Ending

I am wondering about this part:

HTTPClient.NVPair[name=force_filename,value=DSC_2891.JPG], HTTPClient.NVPair[name=auto_rotate,value=no]]
1989617|ERROR|Picture |Couldn't use jpegtran to resize the image, it will be uploaded unrotated
1989618|ERROR|Picture |java.lang.UnsupportedOperationException: jpegtran must be installed for this operation
at com.gallery.GalleryRemote.util.ImageUtils.rotate(ImageUtils.java:471)
at com.gallery.GalleryRemote.model.Picture.getUploadSource(Picture.java:221)
at com.gallery.GalleryRemote.GalleryComm2$UploadTask.uploadPicture(GalleryComm2.java:568)
at com.gallery.GalleryRemote.GalleryComm2$UploadTask.runTask(GalleryComm2.java:486)
at com.gallery.GalleryRemote.GalleryComm2$GalleryTask.run(GalleryComm2.java:294)
at java.lang.Thread.run(Thread.java:552)

1989618|TRACE|GalComm2 |Overriding form data: [HTTPClient.NVPair[name=g2_form[cmd],value=add-item], HTTPClient.NVPair[name=g2_form[protocol_version],value=2.3], HTTPClient.NVPair[name=g2_form[set_albumName],value=101], HTTPClient.NVPair[name=g2_form[caption],value=, encoding=UTF-8], HTTPClient.NVPair[name=g2_form[force_filename],value=DSC_2891.JPG], HTTPClient.NVPair[name=g2_form[auto_rotate],value=no], HTTPClient.NVPair[name=g2_controller,value=remote.GalleryRemote]]

Thanks

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2006-01-05 08:26

Can you run GR and do what you did previously, but don't upload. Instead, open a console and type the jpegtran command-line: something like Contents/MacOS/jpegtran -copy all -rotate 270 -outfile /tmp/thumbs-bob/rot225910083.jpg /tmp/thumbs-bob/tmp1026903420.jpg

Also, what's in /tmp/thumbs-bob?

--
Gallery Remote developer

 
rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Thu, 2006-01-05 23:42

I don't think it is practical to type a command line for evey photo. There's problably going to be 1000 or more photos that may need roatation. I have to get GR to do the rotation, otherwise I would just do it to each photo in Gallery, if there was only a few. Too bad there is no way to edit a large group of photos in Gallery similar to the way one can delete a list of photos.

Is there any other way to do bulk uploads and get the rotation? Why doesn't jpegtran work? It does exist in the Mac package and does seem to be recognized by GR as the evidence in the log shows. As the error message states, it must be malfunctioning.

/tmp/thumbs-bob does not exist.
/tmp/thumbs does exist, but, is empty.

Thanks again.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2006-01-06 09:41

I wasn't suggesting to enter the command-line as a work-around, but as testing.

You can delete /tmp/thumbs it was used by an earlier version, but from now on GR uses /tmp/thumbs-<username>.

I really think /tmp/thumbs-bob does exist while GR is running. Can you check. If it does not, can you reate it, chmod it 777 and try again?

--
Gallery Remote developer

 
rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Sat, 2006-01-07 07:18

Well, that did not work either. Have you got any other ideas? I just tried moving GR to another volume and running it again. I still get the message that jpegtran can't be found or is malfuctioning. Could the permissions be messed up on my HD? Should I run Disk Utility?

 
rgrahame

Joined: 2005-12-20
Posts: 22
Posted: Wed, 2006-01-11 04:22

I'm so frustrated with this. I ran Disk Utility. I downloaded the latest version of Metadata Extractor and added to my Java Extensions and to the GR package. I got one thumbnail that rotated in GR, but, not in Gallery 2. I can't repreat this. I have tried changing Read EXIF in the GR Preferences. Am I missing something? Do I need to install something else?

I need to get this sorted out so I can move on from my 2005 photos to my 2006 photos. Is anyone working on a solution to go directly from iView Media to Gallery 2????

 
pete helme

Joined: 2006-02-09
Posts: 2
Posted: Thu, 2006-02-09 19:04

Anyone ever figure this out? I'm getting the same problem with jpegtran & Gallery Remote on OS 10.4.4. My /tmp/thumbs-phelme/ directory is there and I've set the permissions wide open so anyone can read & write to it. It's as if the temp files are never being written to the directory in the first place so there is nothing to rotate. If I manually copy in a jpeg file and run jpegtran, it works just fine. So it appears the binary itself is working.

/Applications/Gallery\ Remote/Gallery\ Remote.app/Contents/MacOS/jpegtran -copy all -rotate 90 -outfile /tmp/thumbs-phelme/rot1199031581.jpg /tmp/thumbs-phelme/pict3914.jpg

-rw-r--r-- 1 phelme wheel 1956208 Feb 9 10:55 pict3914.jpg
-rw-r--r-- 1 phelme wheel 1932424 Feb 9 10:56 rot1199031581.jpg

Unfortunately, there isn't any more info in the log to work from. From the GalleryRemote log file:

37700|INFO |GalComm2 |Preparing to upload...
37701|TRACE|GalComm2 |add-item parameters: [HTTPClient.NVPair[name=cmd,value=add-item], HTTPClient.NVPair[name=protocol_version,value=2.3], HTTPClient.NVPair[name=set_albumName,value=178], HTTPClient.NVPair[name=caption,value=pict3914.jpg], HTTPClient.NVPair[name=force_filename,value=pict3914.jpg], HTTPClient.NVPair[name=auto_rotate,value=no]]
37701|TRACE|ImageUtils|Executing [Contents/MacOS/jpegtran, -copy, all, -rotate, 90, -outfile, /tmp/thumbs-phelme/rot1199031581.jpg, /tmp/thumbs-phelme/tmp-1667752921.jpg]
37822|TRACE|ImageUtils|Err: Contents/MacOS/jpegtran: can't open /tmp/thumbs-phelme/tmp-1667752921.jpg
37822|TRACE|ImageUtils|Returned with value 1
37822|CRITI|ImageUtils|jpegtran doesn't seem to be working. Disabling
38033|TRACE|StatusBar |level: 0 - Selected 1 picture / 1,910 K - 0

Anyone have any ideas? I think the issue is with GR itself now. Thanks.

 
patrikhson

Joined: 2005-12-23
Posts: 15
Posted: Sun, 2006-03-05 16:28

I have the same problems. I also think the problem might be that the file is not copied to the /tmp/thumb-<username> directory, i.e. that the problem is that jpegtran doesn't have any file to read from.

paour: is it possible to get more debug around the copying of files TO the /tmp directory to make sure the file really end up there? I have been sitting in a terminal window repeatedly doing ls in the /tmp/thumb-<username> directory, and I see no file, but it might be there for such a short period of time.

 
icepic

Joined: 2005-12-12
Posts: 1
Posted: Tue, 2006-06-27 22:38

I'm still seeing this problem as well. I have found out why it is happening, but don't know the programming fix.

My photos that I am uploading are not on my boot partition. If the photo is not on the boot partition it cannot be copied to the tmp folder using the method that is used, if the photo is on the boot partition then it works fine.

So a workaround is to copy all photos that you are going to upload to your boot partition and then they will rotate and upload correctly.

A better fix is if someone who knows java could take a look at the program where it puts the file into the tmp directory just before it calls jpegtran to see if there is another way it could be done to deal with multiple partitions.