forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: richms on October 18, 2005, 02:50:34 am

Title: Lossless jpeg rotation?
Post by: richms on October 18, 2005, 02:50:34 am
I have uploaded a lot of images, but unfortunatly the camera used didnt have the orientation sensor in it to get them the right way up.

They are all 5+ megapixels images, and it seems that the existing rotation doesnt work because of this. Rotating a jpeg should be lossless in any case since I dont want to have the images degrade furthur with another compression cycle.

Can it be done with preserving what little exif data is present in them?
Title: Re: Lossless jpeg rotation?
Post by: Tranz on October 18, 2005, 03:18:40 am
hmmm.... Are you expecting people to download and print the images, or just to view them on your website? For web viewing, the quality does not need to be as high as when printing.

You could use another image app like irfanview, which people tend to recommend if you don't want to spend money on one. I'm not sure if online or irfanview rotation will preserve exif data, though... Someone who knows better could jump in.
Title: Re: Lossless jpeg rotation?
Post by: richms on October 18, 2005, 03:24:01 am
Some people may want to print them, yeah, so I would like to have the big images up there, I have uploaded 2 gigs of images, and dont like the idea of rotating locally and uploading the 10-15% of them that need rotation.

I was hoping there was a patch to put little buttons over the mid-sized image to fire off a copy of jpegtran or similar on the big image to rotate it, and then re-generate the mid sized and the thumbnails from the newly rotated image.
Title: Re: Lossless jpeg rotation?
Post by: Stramm on October 18, 2005, 05:17:06 am
still... it's the best you can do. Rotating the images on the server limits you to GD and ImageMagick (or you serch the web for a command line tool ? I don't know of any ) that both don't rotate lossless. However, the loss in quality is that minimal.. I wouldn't recognize

edit: and of course you'd need enough mem
Title: Re: Lossless jpeg rotation?
Post by: richms on October 18, 2005, 07:47:25 am
jpegtran is a tool that can do it. I will be looking into getting it onto the server later tonight, its the adding buttons in coppermine that would have me reading thru php code for hours finding the right place to add it, that I dont really want to do right now.

Worst case is I make a list of the names and then run it overthem from the shell, but I am limited to where I can access it via ssh from because most places I am are http only internet access :(
Title: Re: Lossless jpeg rotation?
Post by: lrl on January 07, 2006, 01:23:11 am
richms, did you get anywhere with this?  i was hoping for exactly this feature too...
Title: Re: Lossless jpeg rotation?
Post by: kegobeer on January 07, 2006, 04:17:07 am
There's a mod somewhere for using jpegtran.  It only works if you have a host that uses the jpegtran extension.  I've haven't seen too many.

Try searching for jpegtran, and view the oldest topics first.