1

We're receiving the following error when uploading Assets:

Upload failed for Michael-Mabry-COO-MOOYAH-executive.png. The error message was: “Error uploading the file: The file “/nfs/c12/h03/mnt/215595/domains/mooyah.com/html/craft/storage/runtime/temp/assets57c97ea812e213.88692692.png” does not appear to be an image.”

enter image description here

I assumed this was a case of the client formatting the images incorrectly, but I tried it myself and they are valid image files.

Anyone come across this before?

0

My guess is you're using GD for your image processing library and the PNG is in a format that it doesn't recognize. Try installing Imagick. Craft will use it automatically if it sees it's installed and it support a much wider range of image formats.

  • ImageMagick appears to be installed, but Craft isn't picking it up or the server (Media Temple Grid) isn't allowing PHP to access it. mediatemple.net/community/products/grid/207470423/… I don't have access to php.ini so I'm hoping I can do this through htaccess somehow? – Marc Debiak Sep 4 '16 at 23:10
  • They've got an .htaccess solution in the article you linked to? – Brad Bell Sep 5 '16 at 4:37
  • I saw that but it doesn't provide enough detail about how to actually make it work. Any help would be great! – Marc Debiak Sep 6 '16 at 14:35
  • Open your php.ini file and add open_basedir = /nfs:/tmp:/usr/local:/etc/apache2/gs-bin:/usr/bin/convert to it. Probably best contacting MediaTemple as well. – Brad Bell Sep 6 '16 at 17:51
2

I had the same issue on macOS Sierra, running on with the following installed using homebrew:

  • Craft CMS (2.6.2989)
  • nginx (1.12.1)
  • php-fpm 7.1 (7.1.8)
  • php71-imagick (3.4.3)

After a number of hour of digging around I found the following.

By default (don't ask me why), the configuration file for Imagick has image format configuration commented out....Thanks for that guys.

The Fix

Uncomment file format configurations in /usr/local/etc/ImageMagick-7/magic.xml

<magicmap>
  <magic name="GIF" offset="0" target="GIF8"/>
  <magic name="JPEG" offset="0" target="\377\330\377"/>
  <magic name="PNG" offset="0" target="\211PNG\r\n\032\n"/>
  <magic name="TIFF" offset="0" target="\115\115\000\052"/>
</magicmap>

Then restart php-fpm (on macOS it was for me brew services restart php71)

Don't forget!

Once you've done the above, don't forget to run the Update Assets Indexes in Craft CP. This will generate all of the thumbnails for the images.

Run -> Update Assets Indexes

Hope this helps someone. 👍🏻

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.