blueimp/JavaScript-Load-Image

Rotate the image and keep metadata but update/remove EXIF orientation data

andriystabryn opened this issue · 10 comments

Hi there!
I'm trying to rotate the picture based on Orientation but save all meta attributes

loadImage.parseMetaData(
        file,
        function(data) {
            loadImage(file, img => {
              img.toBlob(blob => {
                var blobWithMeta = new Blob(
                    [
                        data.imageHead,
                        blob
                    ],
                    { type: blob.type }
                  );
                resolve(blobWithMeta);
              }, 'image/jpeg');
            }, {
              orientation: true
            });
        },
    );

But the final image still has Orientation meta attribute. How can I remove just one meta from the data.imageHead?

As of now this library does not support writing individual EXIF attributes.
I've marked this as a feature request.

with this code image size getting increase by 4-5 times than original image.
How should i keep it to original size or near to it?

@Nikhil144 the functionality to keep metadata and rotate the picture is unavailable now. It's only feature request

I've updated the title to make the intention of this feature clearer.

ok does setting orientation :true works well for ios ? because for every device this orientation fix worked well on every device including ipad but except iphone 6s .

loadImage(
file,
function (img, data) {
// Do Something
},
{
orientation: true,
imageSmoothingEnabled: true,
maxWidth: 1600,
maxHeight: 800,
canvas: true
},

        )

with above code for most devices orientation issue got fixed . but not for some ios devices

@Nikhil144 If you have an issue that you can reproduce, please create a separate issue ticket.
This ticket here is about adding support to write updated orientation data into the image meta data header.

Regarding iPhone device support, this should not be dependent on the device form factor, but on the supported iOS version and therefore the supported Safari version. iPhone 6s supports the latest (v13) iOS and therefore has support for the orientation feature in this library.

I've released blueimp-load-image@2.31.0 which introduces minimal Exif writer support:
https://github.com/blueimp/JavaScript-Load-Image#exif-writer