0

Thumbnails not loading in assets list in my control panel with my host platform.sh(works in my local docker env).

Call to index.php?p=admin/actions/assets/thumb&uid=29dad26b-ba90-4b26-b9fb-12b3f6ded747&width=67&height=68&v=1617954445%2068w shows The file “uploads/70790C46-B60E-4924-9ED3-B0089CDEE51B.png” does not appear to be an image in logs.

Response header content type was set as image/svg+xml. May be this is the root cause for the issue.

Saw this snippet in cms/src/image/Raster.php

// Make sure the image says it's an image    
$mimeType = FileHelper::getMimeType($path, null, false);
if ($mimeType !== null && strpos($mimeType, 'image/') !== 0 && strpos($mimeType, 'application/pdf') !== 0) {
    throw new ImageException(Craft::t('app', 'The file “{name}” does not appear to be an image.', 
    ['name' => basename($path)]));
}

try {
    $this->_image = $this->_instance->open($path);
} catch (\Throwable $e) {
    throw new ImageException(Craft::t('app', 'The file “{path}” does not appear to be an image.', 
    ['path' => $path]), 0, $e);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.