Conversion depends on size #3514
Unanswered
robert-abram
asked this question in
Q&A
Replies: 1 comment
-
When registering conversions, you can obtain dimensions and use them to build the logic of conversions. public function registerMediaConversions($media = null): void
{
$image = \Spatie\MediaLibrary\Support\ImageFactory::load($media->getPath());
$width = $image->getWidth();
$height = $image->getHeight();
// Next are your conditions
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to create conversion depends on orginal file size for example:
So in my example i have dimension between 1000x1000 - 1500x1500 and my conversion should always fit to this range and depends on size should be converted or stay the same if it's in range.
Beta Was this translation helpful? Give feedback.
All reactions