mirror of
https://code.castopod.org/adaures/castopod
synced 2025-06-06 09:22:01 +00:00
fix: set resized images to 72dpi for compatibility with Apple Podcasts
fixes #282
This commit is contained in:
parent
aa68386667
commit
0b327cb4d9
@ -136,10 +136,17 @@ class Image extends BaseMedia
|
|||||||
|
|
||||||
foreach ($this->sizes as $name => $size) {
|
foreach ($this->sizes as $name => $size) {
|
||||||
$tempFilePath = tempnam(WRITEPATH . 'temp', 'img_');
|
$tempFilePath = tempnam(WRITEPATH . 'temp', 'img_');
|
||||||
$imageService
|
$resizedImage = $imageService
|
||||||
->withFile($this->attributes['file']->getRealPath())
|
->withFile($this->attributes['file']->getRealPath())
|
||||||
->resize($size['width'], $size['height'])
|
->resize($size['width'], $size['height']);
|
||||||
->save($tempFilePath);
|
|
||||||
|
$resizedImageResource = $resizedImage->getResource();
|
||||||
|
|
||||||
|
// set resolution to 72 by 72 for all sizes
|
||||||
|
// Apple Podcasts requires images to be 72 dpi
|
||||||
|
imageresolution($resizedImageResource, 72, 72);
|
||||||
|
|
||||||
|
$resizedImage->save($tempFilePath);
|
||||||
|
|
||||||
$newImage = new File($tempFilePath, true);
|
$newImage = new File($tempFilePath, true);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user