Skip to content

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 <martin@auswoeger.com>
@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