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

Add option to keep metadata/tags in output image #329

Merged
merged 4 commits into from Jan 30, 2020

Conversation

@sauerbraten
Copy link
Contributor

sauerbraten commented Jan 21, 2020

When IMGPROXY_STRIP_METADATA=false, the vips save functions for JPEG and WebP are called with (..., "strip", FALSE, ...). Image rotation metadata is removed when calling vipsImage's Rotate method.

Implements #325.

sauerbraten added 2 commits Jan 21, 2020
by default, all metadata will be stripped (as before)
in case IMGPROXY_STRIP_METADATA is false
@@ -312,6 +319,8 @@ func (img *vipsImage) Rotate(angle int) error {
return vipsError()
}

C.vips_autorot_remove_angle(tmp)

This comment has been minimized.

Copy link
@sauerbraten

sauerbraten Jan 21, 2020

Author Contributor

Is this the right place to strip orientation tags? I also thought about doing it when fetching the image orientation during extractMeta(), but then a second call to extractMeta() would return different values.

Another place where I think this would make sense is vipsImage.Save().

@rufoa

This comment has been minimized.

Copy link

rufoa commented Jan 22, 2020

Would be great if this could be merged!

@DarthSim

This comment has been minimized.

Copy link
Collaborator

DarthSim commented Jan 29, 2020

Hi,

Looks good overall, but we need to remove an ICC profile from the image since we may not remove it. You can do this by modifying vips_icc_import_go:

int
vips_icc_import_go(VipsImage *in, VipsImage **out, char *profile) {
  if (vips_icc_import(in, out, "input_profile", profile, "embedded", TRUE, "pcs", VIPS_PCS_XYZ, NULL))
    return 1;

  vips_image_remove(*out, VIPS_META_ICC_NAME);

  return 0;
}
needed, in case metadata aren't stripped from the output image
@DarthSim DarthSim merged commit 89f8a4e into imgproxy:master Jan 30, 2020
11 checks passed
11 checks passed
ci/circleci: checkout_code Your tests passed on CircleCI!
Details
ci/circleci: go1.11_vips8.6 Your tests passed on CircleCI!
Details
ci/circleci: go1.11_vips8.7 Your tests passed on CircleCI!
Details
ci/circleci: go1.11_vips8.8 Your tests passed on CircleCI!
Details
ci/circleci: go1.12_vips8.6 Your tests passed on CircleCI!
Details
ci/circleci: go1.12_vips8.7 Your tests passed on CircleCI!
Details
ci/circleci: go1.12_vips8.8 Your tests passed on CircleCI!
Details
ci/circleci: go1.13_vips8.6 Your tests passed on CircleCI!
Details
ci/circleci: go1.13_vips8.7 Your tests passed on CircleCI!
Details
ci/circleci: go1.13_vips8.8 Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
@DarthSim

This comment has been minimized.

Copy link
Collaborator

DarthSim commented Jan 30, 2020

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.