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

Use Imagick class #6754

Draft
wants to merge 1 commit into
base: v5/develop
Choose a base branch
from
Draft

Use Imagick class #6754

wants to merge 1 commit into from

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Oct 16, 2024

Description

  • Figure out why ICC profile isn't preserved
  • Think about whether there are any sensible unit tests for the methods that change the Imagick object
  • Set CLI back to use latest ubuntu version

Summary of changes

  • Use Imagick class for im darkroom driver
  • Old CLI version available as im-legacy ( LegacyImageMagick class)

@afbora Maybe you have some ideas here or could try to tackle some as well 🙏

Changelog

Fixes

Breaking changes

Docs

Ready?

  • In-code documentation (wherever needed)
  • Unit tests for fixed bug/feature
  • Tests and CI checks all pass

For review team

  • Add lab and/or sandbox examples (wherever helpful)
  • Add changes & docs to release notes draft in Notion

@afbora
Copy link
Member

afbora commented Oct 16, 2024

I don't have any idea about IM. I've run unit tests. Getting following error for all provider for ::testKeepColorProfileStripMeta()

identify: unknown image property "%[profile:icc]" @ warning/property.c/InterpretImageProperties/4238.

Comment on lines +139 to +149
$this->threads($image, $options);
$image->stripImage();
$this->interlace($image, $options);

$image = $this->coalesce($image);
$this->grayscale($image, $options);
$this->autoOrient($image);
$this->resize($image, $options);
$this->quality($image, $options);
$image = $this->blur($image, $options);
$image = $this->sharpen($image, $options);
Copy link
Member

Choose a reason for hiding this comment

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

Why do some return void and some return object? Can't we all return void or object?

Copy link
Member Author

Choose a reason for hiding this comment

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

Some Imagick methods return a new object, some alter it in place. I don't like it much either, but I didn't find methods that behave in one way or the other consistently.

Copy link
Member

Choose a reason for hiding this comment

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

For ex: can't we do that? If we return itself, it doesn't work?

protected function grayscale(Imagick $image, array $options): Imagick
{
  if ($options['grayscale'] === true) {
    $image->setColorspace(Imagick::COLORSPACE_GRAY);
  }
	
  return $image;
}

@afbora afbora removed their assignment Oct 23, 2024
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.

ImageMagick compatibilty issue on Ubuntu latest as 24
2 participants