[Closed]: Picture orientation doesn't respect EXIF data [Closed]: Picture orientation doesn't respect EXIF data
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Closed]: Picture orientation doesn't respect EXIF data

Started by SDelroen, July 26, 2009, 08:30:55 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

SDelroen

Hi everybody !

I just started using Coppermine, it's really cool !

I'm just experiencing a little problem: when I watch a picture locally on my computer with a picture viewer, it respects the "Orientation" parameter of the EXIF data, but when I upload my pictures to Coppermine, they are all displayed in Landscape format, whatever the EXIF "Orientation" parameter says.

How can I correct that ?

Thank you !

Samuel

PS: I'm not sure whether this problem is a question of upload or of image display, sorry if I posted in the wrong place.

Nibbler

You need to 'physically' rotate the images before uploading them to Coppermine.

SDelroen

Quote from: Nibbler on July 26, 2009, 01:47:32 PM
You need to 'physically' rotate the images before uploading them to Coppermine.

You mean this feature is not implemented in Coppermine ?

Isn't there any plug-in that could do that ?

If not, could be an idea for someone having spare time and programming skills... ;)

Joachim Müller

The image libraries that Coppermine (or any possible plugin) is using (GD or ImageMagick) don't support EXIF but drop that information from the new, rotated file. Therefore, it's not a missing feature from coppermine, but from the image libraries GD and ImageMagick. The coppermine devs will gladly add support for it if the devs of the GD library will support it. Your request is invalid. There can be no mod nor plugin that can accomplish this server-sided. That's why Nibbler suggested to rotate client-sided before uploading, which is easier, faster and much less resources-intensive than performing that on the server.

SDelroen

Hi Joachim, thank you for your reply.

I didn't know that the exif implementation in Coppermine relies on a separate lib.

Coppermine can natively read EXIF and can rotate pictures, so I can't see any reason why it couldn't automatically rotate a pic depending on the EXIF data of that pic...

The very reason why I started using Coppermine is I am using a high resolution camera and a very low spec computer, so opening a photo locally is already a pain, and I just don't want to try rotating one. But my server could handle that easily, I think. (By the way, why would would it be "much less resources-intensive" on the client side than on the server side, in a general case ?)

This feature I am asking for is pretty basic, I would be surprised to be the only one interested in it.

Joachim Müller

Quote from: SDelroen on July 27, 2009, 10:37:15 AM
Coppermine can natively read EXIF and can rotate pictures, so I can't see any reason why it couldn't automatically rotate a pic depending on the EXIF data of that pic...
Look, what rotation in coppermine does is that it actually creates a new file (calculation based on the original-unrotated image). After a successfull creation of the new file it deletes the original and renames the newly created image with the name the original had. Finally, the information in the database about the dimensions are being re-written. That's all. The step of creating a new file is being performed by the GD library, which doesn't support EXIF. Subsequently, the EXIF data stored in the original, unrotated image is lost. As you already figured out, coppermine has got the capabilities to read EXIF data, but it doesn't have the capabilities to write EXIF data. Those capabilities would have to exist in the image library in the first place before we (the coppermine developers) could implement that feature in Coppermine's code. But alas, those EXIF write capabilities don't exist in GD. There's nothing we could do to circumvent that.
Quote from: SDelroen on July 27, 2009, 10:37:15 AMThis feature I am asking for is pretty basic
Basic in functionality, but not in terms of programming.

Quote from: SDelroen on July 27, 2009, 10:37:15 AM
But my server could handle that easily, I think.
That's complete and utter nonsense that could only come from someone who doesn't understand the technology involved. Just false assumptions. Don't!

Quote from: SDelroen on July 27, 2009, 10:37:15 AMI would be surprised to be the only one interested in it.
I don't doubt that many would find that usefull. Personally, I'd find it very usefull if someone invented boots to walk on water, glasses that enable you to see through walls and maybe a belt that enabled you to fly because it negated gravity. Those inventions would be terribly usefull, but they don't get invented for very practical reasons: because it's beyond the capabilities of engineers or inventors, or simply because it's impossible. A similar thing applies for the feature you ask for: just wanting a feature badly doesn't mean that it can be achieved. You need to be a coder to understand why, as much as you need to be an engineer to understand why you can't create the boots to allow you to walk on water. Since you don't seem to be a programmer, you need to accept my statement that it's impossible to code what you're requesting. You're of course welcome to provide custom code that proofs me wrong. If you can't, please stop insisting. The fact that many mind find a feature usefull doesn't mean that impossible things can be done.

SDelroen

Quote from: Joachim Müller on July 27, 2009, 11:46:30 AM
That's complete and utter nonsense that could only come from someone who doesn't understand the technology involved. Just false assumptions. Don't!
I only assumed that my server could rotate the picture much faster than my client, which I still believe to be true.

Quote from: Joachim Müller on July 27, 2009, 11:46:30 AM
Since you don't seem to be a programmer, you need to accept my statement that it's impossible to code what you're requesting. You're of course welcome to provide custom code that proofs me wrong. If you can't, please stop insisting. The fact that many mind find a feature usefull doesn't mean that impossible things can be done.
Unhappily for the world I am supposed to be some kind of a programmer, just I didn't know that GD doesn't have the ability to modify files but only to create ones.
That made me think I understood though I actually didn't, but thanks to your explanation I now do. I apologise for my ignorance, not for my insistance...

Correct me if I'm wrong, but currently, when I rotate a pic in Coppermine, I lose the EXIF data.

I still don't see why it's impossible to rotate a picture depending on its original EXIF data, even if this data is lost in the process...

In pseudo code, would be something like that:

upload(pic)
if(pic.exif.orientation != NULL)
{
    orientation = pic.exif.orientation
    rotate(pic,orientation)
}


Seems quite trivial, but

The EXIF data is lost, right, but that's already what happens if I do it manually, so users should be aware of it.

Joe Carver

Please pardon me for interjecting here, but conceptually there is something generally wrong with.....

Quote from: SDelroen on July 28, 2009, 11:37:40 AM
I only assumed that my server could rotate the picture much faster than my client

IMO the purpose of the server is to serve pages to users and visitors. CPU/memory intensive activities such as what you desire would adversely affect the server's performance and ability to serve efficiently. Yes, it would be convenient for a single user gallery with low traffic, but would be a disaster (IMO) for a busy gallery with many users.

Joachim Müller

Quote from: SDelroen on July 28, 2009, 11:37:40 AM
Correct me if I'm wrong, but currently, when I rotate a pic in Coppermine, I lose the EXIF data.
That's what I said. Thanks for repeating the obvious.

Quote from: SDelroen on July 28, 2009, 11:37:40 AMI still don't see why it's impossible to rotate a picture depending on its original EXIF data, even if this data is lost in the process...
Go ahead and code that if you want,  but please stop lecturing on programming if you claim not to be a programmer, OK?

SDelroen

i-imagine, I don't agree with you. IMHO, the purpose of a server depends on what its owner wants it to do... If I decide that my server should be able to treat memory/CPU intense activity, I will have to scale it in consequence, that's it.

Quote from: Joachim Müller on July 28, 2009, 03:04:28 PM
Go ahead and code that if you want,  but please stop lecturing on programming if you claim not to be a programmer, OK?
Sorry if my speech seemed lecturing to you, that wasn't my point. Feeling lectured by someone who seems wrong mustn't be pleasant, that's why I apologise. So as for me, I felt flamed by your last post, which wasn't pleasant either.

Now, to make it clear, by "I don't see why this or that", what I meant is "You said this or that, I don't understand why".

To be more precise, could you please explain me why the EXIF data cannot be read and then used to automatically start a rotation with the right parameter ?

If you don't want to/don't have time to/have any reason not to explain me, just tell me "I won't explain you", but please don't flame me again.

Have a nice day (or night, wherever you are).

Samuel

Joachim Müller

Quote from: SDelroen on July 29, 2009, 10:49:47 AM
i-imagine, I don't agree with you. IMHO, the purpose of a server depends on what its owner wants it to do... If I decide that my server should be able to treat memory/CPU intense activity, I will have to scale it in consequence, that's it.
You don't seem to understand the limitations of a webserver nor the setup of a webserver. There are many limitations that apply for a webserver: on operating system level, on bandwidth level, memory level, webserver (apache) level, PHP level, connection level. That's why it can't and shouldn't be used for the same thing you use your PC for. Sure, you can use a server to resize a pic, but not a webserver. There is a difference between the term "server" and "webserver": although only three letters, the difference is dramatic. Coppermine is an app that can only run on a webserver, so your rant about using a server for whatever you think is not applicable. Quite frankly: you're wrong. Please let it end here - there is no reason in claiming that you know better. You don't. If you think otherwise, tell people somewhere else about it.

Quote from: SDelroen on July 29, 2009, 10:49:47 AM
To be more precise, could you please explain me why the EXIF data cannot be read and then used to automatically start a rotation with the right parameter ?
It is possible. You want that "auto-rotate on exif property" feature -> you code it. That's what I tried to say. You'll loose the exif information in the rotated pic nevertheless.

Quote from: SDelroen on July 29, 2009, 10:49:47 AMIf you don't want to/don't have time to/have any reason not to explain me, just tell me "I won't explain you"
OK: I won't explain again, as I already have.

Quote from: SDelroen on July 29, 2009, 10:49:47 AMbut please don't flame me again.
I haven't.

Locking.