mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 10:46:43 +02:00
fix: set resized images to 72dpi for compatibility with Apple Podcasts
fixes #282
This commit is contained in:
parent
aa68386667
commit
0b327cb4d9
1 changed files with 10 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue