Skip to content

feature/strip encoder parameter#1421

Merged
olivervogel merged 14 commits intodevelopfrom
deluxetom-feature/strip-encoder-parameter
Jan 18, 2025
Merged

feature/strip encoder parameter#1421
olivervogel merged 14 commits intodevelopfrom
deluxetom-feature/strip-encoder-parameter

Conversation

@olivervogel
Copy link
Copy Markdown
Member

No description provided.

@olivervogel
Copy link
Copy Markdown
Member Author

I added the option to the global configuration and set the default values on the encoders to null which will default to the value of the global configuration.

$manager = ImageManager::withDriver($driver, strip: true); // set global default for all operations
$result = $manager->read('exif.jpg')->toJpeg(); // uses global default
$result = $manager->read('exif.jpg')->toJpeg(strip: false); // overrides global default
$result = $manager->read('exif.jpg')->toJpeg(strip: true); // overrides global default

I'm also thinking about renaming the option from strip to stripMeta? I'm not a native English speaker but I think strip is very arbitrary? What do you think? @deluxetom

Copy link
Copy Markdown
Contributor

@deluxetom deluxetom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I like the global option, it makes it much easier.

As for GD, I agree, it just strips the exif metadata when encoding. I don't really like the method to create a new GD object and encoding to jpeg to remove it though as quality 100 for jpeg isn't lossless.

I would probably just disable the StripModifier for GD and throw an exception that the GD driver already strips metadata when encoding.

@deluxetom
Copy link
Copy Markdown
Contributor

I'm also thinking about renaming the option from strip to stripMeta? I'm not a native English speaker but I think strip is very arbitrary? What do you think? @deluxetom

I think strip is fine, I would just add a PHPDoc to add that it strips exif metadata. I'm not a native English speaker myself

olivervogel and others added 6 commits January 18, 2025 16:17
Co-authored-by: Thomas <thomas@sctr.net>
Co-authored-by: Thomas <thomas@sctr.net>
Co-authored-by: Thomas <thomas@sctr.net>
Co-authored-by: Thomas <thomas@sctr.net>
Co-authored-by: Thomas <thomas@sctr.net>
Co-authored-by: Thomas <thomas@sctr.net>
Copy link
Copy Markdown
Contributor

@deluxetom deluxetom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, once thats merged, I'll fix image-driver-vips to add that modifier

@olivervogel olivervogel merged commit 6b9ce4f into develop Jan 18, 2025
@olivervogel olivervogel deleted the deluxetom-feature/strip-encoder-parameter branch January 18, 2025 15:42
@olivervogel
Copy link
Copy Markdown
Member Author

perfect, once thats merged, I'll fix image-driver-vips to add that modifier

Cool. You can use intervention image ^3.11 for that.

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

Successfully merging this pull request may close these issues.

2 participants