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

GoVips img.Export(params) is adding EXIF metadata even though source image doesn't have EXIF data #385

Open
pavan-aeturi opened this issue Oct 12, 2023 · 0 comments

Comments

@pavan-aeturi
Copy link

pavan-aeturi commented Oct 12, 2023

Hi Team, I'm trying to autorotate an image that has EXIF data, so I've added the libexif dependency to fix rotating images.But all of a sudden I see images with no exif data is generaed with exif metadata. img.Export seems to be adding the EXIF metadata even after performing img.RemoveMetaData(). Is there some way to prevent this from happening? Adding EXIF metadata is adding another 200Bytes to the image, and this at scale is not what we would ideally want.
The below code is vaguely what I'm doing

      // image rotate operation
      if img.HasExif() && img.Orientation() != 0 {
		img.AutoRotate()
      }
     if img.HasExif() {
		if err = img.RemoveMetadata(); err != nil {
			log.ErrorWithFields(ctx, "error_removing_exif_data", err)
		}
     }
    resizedImg, resizedConfig, err := img.Export(&exportParams)
    if err != nil {  
                 log.ErrorWithFields(ctx, "error_running_vips_image_resizing", err)
    }

But img.Export is adding EXIF data always. Is there any way out?

source image
medium

resized image

out_faded

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

1 participant