Forum
Getting MIME type of image
Hello,
I'm trying to get the MIME type of an image using the following template code:
<perch:content id="thumbnail" output="mime" type="image" />
According to the Perch image documentation, this should return the MIME type of the image, but instead I get the following error:
Notice: undefined index mime in [root]/perch/core/lib/PerchFieldTypes.class.php on line 1214
Other output types like 'size' work just fine. The documentation does say that the MIME type of the image will be returned "if known"... is the error occurring because the MIME type is unknown?
Nicole. Is the image file type listed in the perch/config/filetype.ini file. Try this with a known filetype that is on the list and see if you still get this error. Also, is the perch installation on a windows based server or something like xampp because if so you need to enable a setting for this to work. This was the case with my development environment. I just have to remember the setting...
That would occur if the mime type hasn't been detected, yes. Are you using GD or Imagick for image processing?
I'm using ImageMagick, and the file is a JPG.
Can we see your Diagnostic Report please?
Thanks Rachel,
Here is our latest Diagnostic Report. I masked somethings in the report.