mozjpeg
mozjpeg copied to clipboard
MozJPEG can't read the image (PNG support is disabled in this build) - 20191129
Ubuntu 19.10 mozjpeg version 4.0.0 (build 20191129)
MozJPEG can't read the image (PNG support is disabled in this build)
- state current version in error message
- which builds support PNG
If this is not supported at all, update error message.
PNG reading is supported only if:
- your copy of MozJPEG has been built with PNG support ON
- and libpng was installed on the machine where MozJPEG was built
If you already have a binary/existing MozJPEG installation, there's no way to enable PNG support. You must uninstall it, and build a new one from scratch.
This is fine, any build docs on this? I see no mention of png in BUILDING.md.
cmake has PNG_SUPPORTED
option. I think it's -DPNG_SUPPORTED=ON
.
this png question keeps coming up (https://github.com/mozilla/mozjpeg/issues/337)
out of curiosity, what's the necessity specifically for libpng
?
yours: https://github.com/kornelski/lodepng-rust or: https://github.com/image-rs/image-png
are these not good alternatives that can simply be compiled into MozJPEG? png handling is such a common requirement, it feels like any flag should be for excluding png support, rather than including it.
The flag is default ON on master.
There's no particular reason to use libpng, other than it's "standard". Linux distributions prefer unbundling of dependencies, and they will have libpng, but not lodepng as a standalone dynamic library.
libpng is used only by C demo tools. If you're using Rust, then nothing stops you from combining lodepng
and mozjpeg
crates.
PNG_SUPPORTED flag is not used in sharedlib/CMakeLists.txt at all.
So only static version of mozjpeg supportes PNG. Use *-static for PNG support for now.
I am trying to build the project on x64 platform:
$ uname -a
Linux debian 5.8.7-1-amd64 #1 SMP x86_64 GNU/Linux
$ CFLAGS=-m32 LDFLAGS=-m32 cmake -G"Unix Makefiles" .
CMake Error at CMakeLists.txt:7 (project):
Generator
Unix Makefiles
does not support platform specification, but platform
x32
was specified.
Also there is a difference in how build procedure is described in BUILDING.md
cd {build_directory}
cmake -G"Unix Makefiles" [additional CMake flags] {source_directory}
make
### 32-bit Build on 64-bit Linux/Unix/Mac
Use export/setenv to set the following environment variables before running
CMake:
CFLAGS=-m32
LDFLAGS=-m32
and BUILDING.txt
Non-Release Source Build (e.g. GitHub clone)
--------------------------------------------
cd {source_directory}
autoreconf -fiv
cd {build_directory}
sh {source_directory}/configure [additional configure flags]
make
32-bit Build on 64-bit Linux
----------------------------
Add
--host i686-pc-linux-gnu CFLAGS='-O3 -m32' LDFLAGS=-m32
to the configure command line.
I believe that BUILDING.txt
is outdated... shouldn't it be removed then?
Any help is appreciated.