Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserveHeaders parameter should be re-implemented #94

Open
leonli opened this issue Jul 9, 2014 · 5 comments
Open

preserveHeaders parameter should be re-implemented #94

leonli opened this issue Jul 9, 2014 · 5 comments

Comments

@leonli
Copy link

leonli commented Jul 9, 2014

Hi,

I checked out the implement of parameter of preserveHeaders.

Once the parameter set to false, the whole EXIF meta data will be removed after automatically correcting the photo Orientation.

This is useless if I'm trying to resize the image(with automatic orientation correction) then uploading to the server with EXIF data.

I think the elegant solution of this part should be by adding another parameter which will not remove the full EXIF data. Remove the Orientation EXIF tag instead of removing the full EXIF data if it's possible on the runtime on HTML5/Flash.

My project is currently using Plupload and facing the issue, I need to keep EXIF data before uploading to the server but taking the correct Orientation.

You may ask me to do the right job on server side, but the photo uploading server is hosted by our vendor.

I would like to contribute the code for my solution, but at the moment I'm not familiar with ActionScript.

Could anyone can help to have the solution done would be much appreciated.

Best Regards,

Leon

@jayarjo
Copy link
Contributor

jayarjo commented Jul 9, 2014

I do not quite understand what might be the benefit..? Can you describe the actual case?

If you are not familiar with ActionScript you could contribute JavaScript version, or Silverlight.

@leonli
Copy link
Author

leonli commented Jul 10, 2014

The case is simple:
1). enable photo auto orientation.
2). keep the EXIF data from the original file but correct the EXIF tag Orientation value to 1

Done.

Why we have to change the EXIF data?
1). We have to keep the EXIF data on the server side, so we can't just remove all of them.
2). Because we have changed the photo orientation on the client side before uploading, so we need to correct the EXIF data as well, if we don't, other software does the auto orientation job will cause the wrong display of the photo.

@leonli
Copy link
Author

leonli commented Jul 10, 2014

Simply to say, usually, we can have two way to do the right job on application level.
1). Just upload the original image without auto orientation enabled.

this way you will have to process the image orientation 
once you need to display the photo that you uploaded, 
which means you can read the EXIF orientation tag to correct the display of your image.

2). The second way is processing the image before uploading, we can do auto orientation before uploading, but we also need to correct the EXIF data by setting tag Orientation value into 1, because we have done the auto orientation job already, right?

So, in our case, we have to use the solution (2), because our server designed an API to return to the client for displaying a very useful function to our users, which needs the width x height of all images that in the API.

@jayarjo
Copy link
Contributor

jayarjo commented Jul 10, 2014

The reason why I was asking is that usually third party image manipulation services are taking into account the Orientation tag when it is present and auto-rotate the image accordingly. That's why we auto-rotate only when we strip it off and leave the whole thing intact, when - not. While what you are asking is possible, the party to be blamed for the problem in my opinion is that service that as I understood simply ignores the Orientation tag... Have you tried to communicate it with them?

@leonli
Copy link
Author

leonli commented Jul 11, 2014

Yes Davit, Can't agree more. The server side would be easier to provide a better way to solve the issue.
With ImageMagick 's help, it can persist the image with --auto-orient and modify the EXIF Orientation tag from other value to 1, and exchange the width & height if the value of Orientation > 4

I did contact our server vendor, they do provide a solution, but it's not the way by persistence, which means they provide a lazy display solution on the issue:

e.g.: example.com/example.jpg?auto-orient

The solution fits most of the demands, but not ours, because we need to get the width x height for each image from our server API, so if we use the lazy display solution with param auto-orient, the solution from our vendor didn't change the original image, so once the Orientation value is more than 4, the image will not be able to be displayed correctly on our web application.

Anyway, I had resolved the issue on our application server, which will upload the original image by using Plupload, then we will process the width & height between our application server and vendor's image processing server.

But what I'm going to say here is that why don't Plupload provide a better solution on the client side?
More elegant.
Not just purge all EXIF tags when it's doing auto-orient, but replace the Orientation tag value to 1

Think about the the case, if the auto-orient has been taking on client side and EXIF is replaced, then the server will get the right width & height because it's already been rotated.

Above is my use case, just hope Plupload could make the part of auto-orient better.

Best Regards,

Leon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants