You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug here that is just now manifesting, or a bug in IM (or both?). According to their changelog, it looks like they somewhat recently revised the PDF reader.
Given a PDF exported by Adobe Illustrator, the identify command now outputs Mt Moon.pdf AI 810x1242 810x1242+0+0 16-bit ColorSeparation CMYK 3.83776MiB 0.010u 0:00.010
What it used to output is Mt Moon.pdf PDF 810x1242 810x1242+0+0 16-bit ColorSeparation CMYK 3.83776MiB 0.400u 0:00.389
With -verbose added on, they both give the correct mime-type: Image: Mt Moon.pdf Format: AI (Adobe Illustrator CS2) Mime type: application/pdf
That was a poor decision to build the MIME type this way (by prepending image/), as ImageMagick can work with lots of formats that don't have image/* MIME types, like PDFs that you mentioned.
It should get changed to output correct values, maybe with a new major release then.
This cannot be fixed in a backwards compatible way, as
defmime_typeself["data"]["mimeType"]end
will be significantly slower, because the whole image has to be read, unlike with current implementation where only the magic header needs to be read.
I don't think ImageMagick is sufficiently good for determining MIME types, there are Marcel and MimeMagic that are able to do this by just reading the header file. So, I will be deprecating MiniMagick::Image#mime_type.
I'm not sure if this is a bug here that is just now manifesting, or a bug in IM (or both?). According to their changelog, it looks like they somewhat recently revised the PDF reader.
Given a PDF exported by Adobe Illustrator, the identify command now outputs
Mt Moon.pdf AI 810x1242 810x1242+0+0 16-bit ColorSeparation CMYK 3.83776MiB 0.010u 0:00.010
What it used to output is
Mt Moon.pdf PDF 810x1242 810x1242+0+0 16-bit ColorSeparation CMYK 3.83776MiB 0.400u 0:00.389
With -verbose added on, they both give the correct mime-type:
Image: Mt Moon.pdf Format: AI (Adobe Illustrator CS2) Mime type: application/pdf
Image: Mt Moon.pdf Format: PDF (Portable Document Format) Mime type: application/pdf
The
mime_type
method in MiniMagick doesn't actually use that value, it takes the format (AI or PDF) and just adds it onto image/.So what we now get is
image/ai
instead ofimage/pdf
. Evenimage/pdf
isn't technically right, it should beapplication/pdf
An easy way to get the proper value
This would of course be breaking to everyone expecting the old behavior of outputting image/pdf.
The text was updated successfully, but these errors were encountered: