Closed oaleynik closed 8 years ago
Tried to compile libvips
with the all possible flags. The only change I see is webp
format was read successfully.
Running vipsheader *
gives interesting results:
vipsheader: VipsForeignLoad: "image.AAI" is not a known file format
image.ART: 100x100 uchar, 1 band, rgb, magickload
image.AVS: 100x100 uchar, 3 bands, rgb, magickload
image.BMP: 100x100 uchar, 3 bands, rgb, magickload
image.BMP2: 100x100 uchar, 3 bands, rgb, magickload
image.BMP3: 100x100 uchar, 3 bands, rgb, magickload
vipsheader: magick2vips: unable to read file "image.CIN"
libMagick error: Unexpected end-of-file image.CIN
image.CLIPBOARD: 100x100 uchar, 3 bands, srgb, pngload
image.DCX: 100x100 uchar, 3 bands, rgb, magickload
vipsheader: VipsForeignLoad: "image.DDS" is not a known file format
image.DIB: 100x100 uchar, 3 bands, rgb, magickload
image.DPX: 100x100 uchar, 4 bands, rgb, magickload
image.EPDF: 100x100 uchar, 3 bands, rgb, magickload
image.EPI: 100x100 uchar, 3 bands, rgb, magickload
image.EPS: 100x100 uchar, 3 bands, rgb, magickload
image.EPSF: 100x100 uchar, 3 bands, rgb, magickload
image.EPSI: 100x100 uchar, 3 bands, rgb, magickload
image.EPT: 100x100 uchar, 3 bands, rgb, magickload
image.EXR: 100x100 uchar, 3 bands, srgb, pngload
image.FAX: 2592x100 uchar, 1 band, rgb, magickload
image.FITS: 100x100 uchar, 3 bands, rgb, fitsload
image.FPX: 100x100 uchar, 3 bands, srgb, pngload
image.GIF: 100x100 uchar, 3 bands, rgb, magickload
image.HDR: 100x100, rad, radload
image.HRZ: 256x240 uchar, 3 bands, rgb, magickload
image.INLINE: 100x100 uchar, 3 bands, srgb, pngload
image.J2C: 100x100 uchar, 3 bands, srgb, pngload
image.J2K: 100x100 uchar, 3 bands, srgb, pngload
image.JBIG: 100x100 uchar, 3 bands, srgb, pngload
image.JNG: 100x100 ushort, 3 bands, rgb16, magickload
image.JP2: 100x100 uchar, 3 bands, srgb, pngload
image.JPEG: 100x100 uchar, 3 bands, srgb, jpegload
image.JPT: 100x100 uchar, 3 bands, srgb, pngload
image.MIFF: 100x100 uchar, 3 bands, rgb, magickload
image.MNG: 100x100 uchar, 3 bands, rgb, magickload
vipsheader: VipsForeignLoad: "image.MPC" is not a known file format
image.MPR: 100x100 uchar, 3 bands, srgb, pngload
image.MTV: 100x100 uchar, 3 bands, rgb, magickload
image.OTB: 100x100 ushort, 1 band, rgb16, magickload
image.P7: 100x100 uchar, 3 bands, srgb, pngload
image.PALM: 100x100 uchar, 1 band, rgb, magickload
image.PBM: 100x100 uchar, 1 band, b-w, ppmload
image.PCD: 768x512 uchar, 3 bands, rgb, magickload
image.PCDS: 768x512 uchar, 3 bands, rgb, magickload
image.PCX: 100x100 uchar, 3 bands, rgb, magickload
image.PDB: 112x100 uchar, 1 band, rgb, magickload
image.PDF: 100x100 uchar, 3 bands, rgb, magickload
image.PFM: 100x100 float, 3 bands, srgb, ppmload
image.PGM: 100x100 uchar, 1 band, b-w, ppmload
image.PICON: 48x48 uchar, 3 bands, rgb, magickload
image.PICT: 100x100 ushort, 3 bands, rgb16, magickload
image.PNG00: 100x100 uchar, 3 bands, srgb, pngload
image.PNG24: 100x100 uchar, 3 bands, srgb, pngload
image.PNG32: 100x100 uchar, 4 bands, srgb, pngload
image.PNG48: 100x100 ushort, 3 bands, rgb16, pngload
image.PNG64: 100x100 ushort, 4 bands, rgb16, pngload
image.PNG8: 100x100 uchar, 3 bands, srgb, pngload
image.PNM: 100x100 uchar, 3 bands, srgb, ppmload
image.PPM: 100x100 uchar, 3 bands, srgb, ppmload
image.PS: 100x100 uchar, 3 bands, rgb, magickload
image.PS2: 100x100 uchar, 3 bands, rgb, magickload
image.PS3: 100x100 uchar, 3 bands, rgb, magickload
vipsheader: VipsForeignLoad: "image.PSB" is not a known file format
image.PSD: 100x100 uchar, 3 bands, rgb, magickload
vips warning: tiff2vips: no resolution information for TIFF image "image.PTIF" -- defaulting to 1 pixel per mm
image.PTIF: 100x100 uchar, 3 bands, srgb, tiffload
image.RFG: 100x100 uchar, 3 bands, srgb, pngload
image.SGI: 100x100 uchar, 3 bands, rgb, magickload
image.SUN: 100x100 uchar, 3 bands, rgb, magickload
vipsheader: VipsForeignLoad: "image.SVG" is not a known file format
image.TGA: 100x100 uchar, 3 bands, rgb, magickload
vips warning: tiff2vips: no resolution information for TIFF image "image.TIFF" -- defaulting to 1 pixel per mm
image.TIFF: 100x100 uchar, 3 bands, srgb, tiffload
image.TXT: 100x100 ushort, 3 bands, rgb16, magickload
image.VICAR: 100x100 uchar, 1 band, rgb, magickload
image.VIFF: 100x100 ushort, 3 bands, rgb16, magickload
image.WBMP: 100x100 ushort, 1 band, rgb16, magickload
image.WEBP: 100x100 uchar, 3 bands, srgb, webpload
image.X: 100x100 uchar, 3 bands, srgb, pngload
image.XBM: 100x100 uchar, 1 band, rgb, magickload
image.XPM: 100x100 uchar, 3 bands, rgb, magickload
image.XWD: 100x100 uchar, 3 bands, srgb, pngload
Hello, when the call to metadata()
produced null
, were these same errors also provided?
@lovell yes, for CIN format error is Input buffer has corrupt header
. All others has Input buffer contains unsupported image format
error
vipsheader
were not able to read CIN format too (throws libMagick error: Unexpected end-of-file image.CIN
)
For others vipsheader
were not able to read headers just for 5 formats:
vipsheader: VipsForeignLoad: "image.AAI" is not a known file format
vipsheader: VipsForeignLoad: "image.DDS" is not a known file format
vipsheader: VipsForeignLoad: "image.MPC" is not a known file format
vipsheader: VipsForeignLoad: "image.PSB" is not a known file format
vipsheader: VipsForeignLoad: "image.SVG" is not a known file format
Just to clarify - null
in the output above is not the actual output by sharp
. I mark images with null
, when sharp
was not able to get image metadata.
I notice libvips uses fitsload
and ppmload
for some of those formats. If you have a genuine need for those formats then we'll need to modify sharp to detect/support those loaders.
For those formats where magickload
was attempted, if you reverse the script that created these images, can they be to convert
-ed back to a valid PNG? For example the vector SVG format is supported but the input file you've auto-generated could be empty.
It's also worth checking the "L" column in the output of convert -list format
as convert
support for some of these formats is considered Unstable.
If reverse script and try to convert generated files back to PNG imagemagick's convert
stops without any errors at about 1/3 of the full set of images. GraphicsMagick completes them all. SVGs and most of the null
formats were converted back successfully, however it has troubles with some of them:
gm convert: No decode delegate for this image format (assets/image.AAI).
gm convert: invalid chromaticities (reversed/assets/image.BMP.png).
gm convert: Unexpected end-of-file (assets/image.CIN).
gm convert: No decode delegate for this image format (assets/image.DDS).
gm convert: No decode delegate for this image format (assets/image.HDR).
gm convert: Unable to open cache (assets/image.MPC) [No such file or directory].
gm convert: No decode delegate for this image format (assets/image.PFM).
gm convert: Improper image header (assets/image.PSB).
gm convert: No decode delegate for this image format (assets/image.WEBP).
Related to the convert -list format
: I don't have the "L" column. I use ImageMagick 6.9.3-0 Q16 x86_64 2016-01-08
So, it looks like I just misunderstood the phrase: This module supports reading JPEG, PNG, WebP, TIFF, OpenSlide, GIF and other libmagick-supported formats. It is not super critical for now, but would be helpful to have clarification regarding magick formats in documentation :) Thanks @lovell for quick response! Closing this for now.
Commit 906fb67 on the mind
branch (v0.13.0) adds support for a few extra formats on your megalist when using libvips compiled with PPM and FITS.
Thank you @lovell! I just checked - FITS and PPM has no issues with mind
branch. I dig into the sources of vips
and libmagick
. Wanna get better understanding how they work together so if I will need other format in sharp
I can add it on my own and send PR :)
Hey @lovell!
Just wondering, if
libvips
compiled with the--with-imagemagick
flag, does it mean thatsharp
should be able to read (at least) all of the file formats listed here http://www.imagemagick.org/script/formats.php?I did the simple test. From the list of the magick formats I took
RW
s and using PNG 100x100 image as input I generated set of 80 images.Running
identify *
gives the following results:So, ImageMagick can easily read metadata of all of the generated images. However, if run
sharp
through the set of the same images and try to get their metadata I have the following picture:Am I missing something and
libvips
requires some extra flags to be compiled with?