blueimp / JavaScript-Load-Image

Load images provided as File or Blob objects or via URL. Retrieve an optionally scaled, cropped or rotated HTML img or canvas element. Use methods to parse image metadata to extract IPTC and Exif tags as well as embedded thumbnail images, to overwrite the Exif Orientation value and to restore the complete image header after resizing.
https://blueimp.github.io/JavaScript-Load-Image/
MIT License
4.46k stars 923 forks source link

Change only orientation keeping other head as is #121

Closed hnviradiya closed 4 years ago

hnviradiya commented 4 years ago

Is it possible to maintain metadata by only changing orientation?

I have created following jsbin where when I replace head, it is losing orientation. Is there a way to fix this?

https://jsbin.com/cemeqeniru/2

I have created question on stack overflow.

https://stackoverflow.com/questions/64154314/change-only-image-orientation-keeping-other-head-as-is

blueimp commented 4 years ago

Yes you can, with the exif writer functionality: https://github.com/blueimp/JavaScript-Load-Image#exif-writer

hnviradiya commented 4 years ago

Oh. Why did i think that other functions were of no use to my current requirement. I spent lot of time to figure out. Sorry to create this issue. And thanks a lot for your prompt response.

hnviradiya commented 4 years ago

seems still something wrong. image orientation is not changing. I am using following image. DSCN0010

I have updated link with exif-writer https://jsbin.com/niretatebi/1/edit?html,output

hnviradiya commented 4 years ago

Got that fixed. orientation: 1 was still required: { meta: true, orientation: 1, canvas: true }

https://jsbin.com/votobatiqo/edit?html,output