Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't process good old windows bitmap files any more #851

Closed
DaGaMs opened this issue Jan 11, 2018 · 11 comments
Closed

Can't process good old windows bitmap files any more #851

DaGaMs opened this issue Jan 11, 2018 · 11 comments
Labels

Comments

@DaGaMs
Copy link

DaGaMs commented Jan 11, 2018

Another issue: this fairly "standard" .bmp windows bitmap file does not process:

$> vipsthumbnail -s 120 -f test.png bmp_example.bmp 
vipsthumbnail: unable to thumbnail bmp_example.bmp
VipsForeignLoad: "bmp_example.bmp" is not a known file format

I believe this is something to do with the image header - but this also used to work in an older version of vips (8.5.0)?

bmp_example.bmp.zip

@jcupitt
Copy link
Member

jcupitt commented Jan 11, 2018

libvips has nothing for BMP files -- these are loaded via libMagick, the imagemagick wrapper. This is disabled by default on homebrew for security reasons.

Try installing libvips with:

brew install vips --with-imagemagick

@jcupitt
Copy link
Member

jcupitt commented Jan 11, 2018

There are some notes on the "install" page:

http://jcupitt.github.io/libvips/install.html

@DaGaMs
Copy link
Author

DaGaMs commented Jan 11, 2018

my bad - will close, sorry!

@DaGaMs DaGaMs closed this as completed Jan 11, 2018
@jcupitt
Copy link
Member

jcupitt commented Jan 11, 2018

No problem!

@DaGaMs
Copy link
Author

DaGaMs commented Jan 12, 2018

hmm, still not happy. I rebuilt vips like this:

brew install --build-from-source vips --with-openslide --with-graphicsmagick --with-openexr --with-webp --with-mozjpeg --with-jpeg-turbo

but I still get the same result from vips:

>$ vipsthumbnail -s 120 -f test.png test/example_data/bmp_example.bmp
vipsthumbnail: unable to thumbnail test/example_data/bmp_example.bmp
VipsForeignLoad: "test/example_data/bmp_example.bmp" is not a known file format

However, it does work when compiling with imagemagick instead of graphicsmagick. I'm not sure if that's a bug?

@DaGaMs DaGaMs reopened this Jan 12, 2018
@jcupitt
Copy link
Member

jcupitt commented Jan 12, 2018

I've not tested with GM for a while, I'll have a go here. Do you know what GM version brew is using?

@DaGaMs
Copy link
Author

DaGaMs commented Jan 12, 2018

brew info graphicsmagick gives me

/usr/local/Cellar/graphicsmagick/1.3.27 (479 files, 12MB) *
  Poured from bottle on 2018-01-11 at 15:25:17

@jcupitt
Copy link
Member

jcupitt commented Jan 12, 2018

It's working here with 1.3.26. I'll try 1.3.27.

john@yingna ~/GIT/libvips (8.6) $ ldd `which vipsheader` | grep -i magi
	libGraphicsMagick-Q16.so.3 => /usr/lib/libGraphicsMagick-Q16.so.3 (0x00007f7fff542000)
john@yingna ~/GIT/libvips (8.6) $ vipsheader ~/pics/MARBLES.BMP 
/home/john/pics/MARBLES.BMP: 1419x1001 uchar, 3 bands, rgb, magickload

@jcupitt
Copy link
Member

jcupitt commented Jan 12, 2018

Oh I think I have it, try adding --env=std to your brew build line. This will let vips pick up dependencies from your already-installed packages.

Check the output of configure to make sure it's seen your GM.

@jcupitt
Copy link
Member

jcupitt commented Jan 12, 2018

I tried 1.3.27 and it seems to work. I built GM like this:

$ CFLAGS="-g -Wall" CXXFLAGS="-g -Wall" ./configure --prefix=/home/john/vips --disable-static --enable-shared --with-quantum-depth=16
$ make
$ make install

And then:

$ CFLAGS="-g -Wall" CXXFLAGS="-g -Wall" ./autogen.sh --prefix=/home/john/vips --with-magickpackage=GraphicsMagick
$ make
$ make install
$ ldd `which vipsheader` | grep -i magi
	libGraphicsMagick.so.3 => /home/john/vips/lib/libGraphicsMagick.so.3 (0x00007fdc85f53000)
$ vipsheader ~/pics/MARBLES.BMP 
/home/john/pics/MARBLES.BMP: 1419x1001 uchar, 3 bands, rgb, magickload

@jcupitt
Copy link
Member

jcupitt commented Feb 1, 2018

I'll close. Please reopen if there is still a problem.

@jcupitt jcupitt closed this as completed Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants