cloudacy / native_exif

A simple EXIF metadata reader/writer for Flutter.
MIT License
16 stars 17 forks source link

How to change x and y pixel resolution and image width and height. #9

Closed JarrodLodge closed 1 year ago

JarrodLodge commented 1 year ago

Using a similar library in NodeJS I am able to set the X/Y resolution and the image width and height. I can't seem to make this work with this library.

Code below is from https://github.com/hMatoba/piexifjs

zeroth[piexif.ImageIFD.XResolution] = [300, 1];
zeroth[piexif.ImageIFD.YResolution] = [300, 1];
zeroth[piexif.ImageIFD.ImageWidth] = 5;
zeroth[piexif.ImageIFD.ImageHeight] = 7;

This is what im trying below, are my tag names wrong?

await exif.writeAttributes({
    "ImageWidth": 5,
    "ImageHeight": 7,
    "PixelXDimension": [300, 1],
    "PixelYDimension": [300, 1],
  });
d-kuen commented 1 year ago

Hi,

only specific attributes are supported by this package. Please have a look here for more details.

As a workaround we would recommend to resize the image.