Skip to content

Conversation

@Chris53897
Copy link
Contributor

@Chris53897 Chris53897 commented Nov 15, 2025

based on #204 (comment)
snapshots generated on mac

Update: it looks like renaming a file does break the comparing


protected function getSnapshotId(): string
{
$version = mb_substr(\Imagick::getVersion()['versionString'], 12, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently this uses a fixed offset to grab the (assumed one‑digit) major version. You might consider a more robust approach, like:

$versionString = \Imagick::getVersion()['versionString'];

if (!preg_match('/^ImageMagick (\d+)\./', $versionString, $matches)) {
    throw new RuntimeException("Unable to extract ImageMagick major version from: {$versionString}");
}

$version = $matches[1];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Why does ImageMagick not provide a function like symfony to just get the major version and more details in an array?

I can change it, but first i need to fix the real issue with the failing snapshot

@DASPRiD
Copy link
Member

DASPRiD commented Nov 15, 2025

Thanks @Chris53897 – I already implemented a proper fix in #206

@DASPRiD
Copy link
Member

DASPRiD commented Nov 15, 2025

Fixed in #206

@DASPRiD DASPRiD closed this Nov 15, 2025
@Chris53897
Copy link
Contributor Author

Thanks @DASPRiD

@vlakoff
Copy link
Contributor

vlakoff commented Nov 15, 2025

I think this PR attempt effectively showed that managing multiple sets of snapshots would have ended up being too confusing and troublesome.

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.

4 participants