Skip to content

Enables the GD support for resolution options group for PHP 7 >= 7.2, PHP 8.0. #813

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

Closed
wants to merge 4 commits into from

Conversation

gutocf
Copy link
Contributor

@gutocf gutocf commented Dec 15, 2021

Example:

<?php

use Imagine\Image\ImageInterface;

$imagine = new Imagine\Gd\Imagine();

$options = array(
    'resolution-units' => ImageInterface::RESOLUTION_PIXELSPERINCH,
    'resolution-x' => 300,
    'resolution-y' => 300,
);

$imagine->open('/path/to/image.jpg')->save('/path/to/image.jpg', $options);

Copy link
Collaborator

@ausi ausi left a comment

Choose a reason for hiding this comment

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

Apart from the coding style, this looks great! ❤️

Apply correct code style.

Co-authored-by: Martin Auswöger <[email protected]>
@bartthys
Copy link

bartthys commented Feb 1, 2024

Hi @gutocf @ausi I'm looking for exactly this feature, I see the PR was approved but it was never merged?

@ausi
Copy link
Collaborator

ausi commented Feb 1, 2024

@bartthys I’m not a maintainer of this repository, so my approval has no “official” meaning ☺️

@ausi
Copy link
Collaborator

ausi commented Feb 1, 2024

In the meantime you can workaround that by using something like this in your code:

if ($yourImage instanceof \Imagine\Gd\Image) {
	imageresolution($yourImage->getGdResource(), $resolutionXppi, $resolutionYppi);
}

@mlocati
Copy link
Collaborator

mlocati commented Dec 3, 2024

Superseded by #866

@mlocati mlocati closed this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants