So I found a lot of threads about the thumbs getting a black background. Now it seems at my case on the server of the client it’s in the upload process. Because when I upload the PNG directly via the FTP it will work without a problem. When I upload via the panel it will have a black background. Any idea what can be wrong?
Does this affect thumbs or the original images? Usually, images should be preserved on upload with no modifications. Only if you resize images on upload, Kirby would create thumbs (and of course, Kirby creates thumbs for the Panel, but in that case, it doesn’t matter if you upload via FTP or via the Panel).
Maybe switch thumb driver. If you are using GD, switch to IM or vice versa. thumbs | Kirby CMS
Sounds to me that maybe somethings getting corrupted during the upload process.
The thing is I am not even using a driver (from what I know). Below my setup for this section of the website. If you scroll down on the homepage you see the PNG’s I am talking about. I fixed most of them by hand (uploading via FTP) but one is still the damaged one. Any ideas?
<?php $items = page('home')->clients_logos()->toStructure()->shuffle(); foreach ($items as $item): ?>
<div class="marquee-item">
<?php if($image = $item->img()->toFile()): ?>
<?php if($image->extension() === 'png'): ?>
<img src="<?= $image->url() ?>" alt="<?= $item->alt() ?>" />
<span><?= $item->alt() ?></span>
<?php elseif($image->extension() === 'svg'): ?>
<?= $image->read() ?>
<span><?= $item->alt() ?></span>
<?php else: ?>
<p>invalid file type</p>
<?php endif ?>
<?php endif ?>
</div>
<?php endforeach ?>
Hm, the interesting thing is that if I try to download that particular image, it wants to store it as .jpg instead of .png, whereas the correct images would store as their correct types. And that despite the fact that the network tab shows them as their correct types.
Since you are not using thumbs but the full size images, it shouldn’t be an issue with the thumbs engine or the driver at all.
Yeah, looks like on upload something is changing the file. I have the feeling this is a unique use-case