Hi. Bruno. Thanks for your reply.

I'll test it the following way you suggested.

> 1. Grab an image with some EXIF data
> 2. Run exiftool and save the output somewhere
> 3. Run your code
> 4. Run exiftool again on the reduced image, save the output somewhere
> 5. Diff the output

I will report the results on this thread.

Regards.

2022年10月27日(木) 10:32 Bruno Kinoshita <ki...@apache.org>:

> Hi Cotton,
>
> I think your concerns are valid. I had a quick look and couldn't see in
> updateExifMetadataLossy() chain of methods called anywhere where it would
> update the ImageWidth and ImageLength.
>
> But probably the best way is to test yourself to verify it. You can try the
> following:
>
> 1. Grab an image with some EXIF data
> 2. Run exiftool and save the output somewhere
> 3. Run your code
> 4. Run exiftool again on the reduced image, save the output somewhere
> 5. Diff the output
>
> I **think** you would have to adjust the image/length. But it would be nice
> to confirm that. We should improve the javadoc of these classes as well to
> document whether developers should worry about that or not. I'm moving
> between countries this week/weekend, so I won't have time to create issues
> and work on that for a while. But you can reply here if you are able to
> confirm, or ping this thread again in a few months and I'd be happy to try
> that.
>
> If you find anything broken or have suggestions for improvements in Commons
> Imaging, feel free to create a JIRA Issue for those tasks. As for language,
> do not worry because your English is fine. If you need help translating,
> try deepl.com, Google Translate, and other free translation services that
> may assist you too (that's what I'm doing right now, as I'm going to a
> country where I don't speak the native language :)
>
> Cheers
>
> Bruno
>
> On Wed, 26 Oct 2022 at 22:27, cottonspace <cottonsp...@gmail.com> wrote:
>
> > Hello. I don't use English on a usually. Sorry for the hard-to-read my
> > message.
> >
> > Thank you for publishing such a wonderful library.
> >
> > I want to resize an image, and apply Exif meta information (orientation
> > direction, author, and so on) in original to the image after resized
> image.
> > My code is like this.
> >
> > --- begin ---
> > // Original Image
> > byte[] original = load(file); // some loader
> >
> > // Edit (resize, rotate, ..)
> > byte[] resized = resize(original, width, height); // some edit methods
> >
> > // Apply original metadata into resized image
> > TiffImageMetadata exif = ((JpegImageMetadata)
> > Imaging.getMetadata(original)).getExif();
> > ByteArrayOutputStream baos = new ByteArrayOutputStream();
> > new ExifRewriter().updateExifMetadataLossy(resized, baos,
> > exif.getOutputSet());
> > byte[] result = baos.toByteArray();
> > --- end ---
> >
> > Can I apply the OutputSet got from the original image to the image after
> > resizing with ExifRewriter ?
> >
> > My question is that if the Dimension information such as Orientation
> > information contained in Exif is reflected by ExifRewriter, it will
> affect
> > the actual image size. Doesn't the direction and the Exif information
> > conflict with each other?
> >
> > My concerns are unnecessary? Please teach me.
> >
> > --
> > cotton
> >
>


-- 
cottonsp...@gmail.com

Reply via email to