summaryrefslogtreecommitdiff
path: root/source/fitz/load-jpx.c
AgeCommit message (Collapse)Author
2018-10-25Guard loading embedded ICC profiles in images with FZ_ENABLE_ICC.Tor Andersson
Stops all the extra errors and warnings about missing ICC support.
2018-10-23Remove extra blank lines.Tor Andersson
2018-09-19Update to OpenJPEG 2.3.0.Sebastian Rasmussen
There is a regression for 2325_-_JPX_image_with_padding_rejected.pdf. Object 3 in that document is a JPX-encoded image. Its EOC marker is preceded by two extra bytes of data, 0x80 0x80. This makes the file broken according to the JPEG 2000 specification. Acrobat Reader and the Kakadu JPX decoder accepts this file without issues, so OpenJPEG 2.1.0 added code to fix this (bug 226, commit 005e75bdc). That fix detects exactly two bytes of 0x80 0x80, a rather brittle fix. Adding more padding or changing the padding byte values is not accepted. Adding more padding is acceptable to Acrobat Reader and Kakadu. An unrelated fix for another problem has since broken OpenJPEG's support for this broken image.
2018-09-13jpx: Handle ICC color profiles.Sebastian Rasmussen
2018-09-13Bug 699769: Fix bugs in upsampling code for JPX images.Sebastian Rasmussen
The upsampling code in the JPX decode attempted to guess a suitable upsampling factor. The guessed factor was wrong, causing writes of samples outside of the decoded image buffer. Simply limiting the coordinates to the image buffer would not suffice because the factor was wrong for every upsampled row of pixels. openjpeg does provide an upsampling factor, so use that instead and also take the component offsets into account when decoding components into the pixmap. Combined this resolves the issue that previously triggered ASAN. Thanks to oss-fuzz for reporting.
2018-04-11Remove needless #defines in load-jpx.cTor Andersson
2018-02-01Drop JPEG/J2K/JPEG-XR/PNG/TIFF colorspaces even upon exception.Sebastian Rasmussen
For TIFF it was not just the colorspace, but other data as well.
2018-01-04Bug 698836: Fix build with FZ_ENABLE_JPX=0.Tor Andersson
2017-11-09Bug 698307: Improve stdint.h detection logic in openjpeg wrapper.Robin Watts
Thanks to Tamir Evan for this tweak.
2017-11-09Bug 698353: Avoid having our API depend on DEBUG/NDEBUG.Robin Watts
Currently, our API uses static inlines for fz_lock and fz_unlock, the definitions for which depend on whether we build NDEBUG or not. This isn't ideal as it causes problems when people link a release binary with a debug lib (or vice versa). We really want to continue to use static inlines for the locking functions as used from MuPDF, as we hit them hard in the keep/drop functions. We therefore remove fz_lock/fz_unlock from the public API entirely. Accordingly, we move the fz_lock/fz_unlock static inlines into fitz-imp.h (an internal header), together with the fz_keep_.../fz_drop_... functions. We then have public fz_lock/fz_unlock functions for any external callers to use that are free of compilications. At the same time, to avoid another indirection, we change from holding the locking functions as a pointer to a struct to a struct itself.
2017-11-01Use int64_t for public file API offsets.Tor Andersson
Don't mess with conditional compilation with LARGEFILE -- always expose 64-bit file offsets in our public API.
2017-10-25Fix colorspace reference counting in fz_load_*_info.Tor Andersson
These are called from fz_new_image_from_buffer.
2017-10-12Make image loading use const data pointers.Tor Andersson
2017-09-07Initialize variables to appease clang scan-build.Sebastian Rasmussen
2017-09-05Make luratech decoder glue compile after interface changes.Sebastian Rasmussen
2017-07-19Add spots to fz_pixmaps.Robin Watts
Update separations interface further to cope with whether spots should be rendered separately, or as composite colors.
2017-07-17Don't convert cmyka images to rgbaMichael Vrhel
We should handle the cmyka images in their native form now that we are holding the data inverted. Fixes fts_17_1700.pdf Also fixes fts_43xx.xps
2017-07-06fz_var() variables must be initialized before fz_try.Sebastian Rasmussen
2017-07-03Avoid leaking jpx structure if corrupt file.Robin Watts
2017-06-16MSVC: Avoid signed/unsigned warning.Robin Watts
2017-06-08Plug leak of opj decoder in case of fz_new_pixmap() throwing.Sebastian Rasmussen
2017-06-06Declare functions without arguments as taking void.Sebastian Rasmussen
2017-06-03jpx: Use subsampled width when reading subsampled data.Sebastian Rasmussen
This bug caused an indeterminism with issue726.j2k.
2017-05-31Avoid double literals causing casts to float.Sebastian Rasmussen
2017-05-29Tweak JPEG2000 colorspace detection.Tor Andersson
2017-04-27Include required system headers.Tor Andersson
2017-04-05jpx: Make Luratech decoder glue layer compile.Sebastian Rasmussen
2017-02-06Fix Win32 builds.Robin Watts
2017-01-23android: Add ndk-build makefile to build JNI library for android viewers.Sebastian Rasmussen
Run 'make android' to invoke ndk-build with the proper arguments. The results are placed in build/android.
2017-01-17Fix typos.Sebastian Rasmussen
2016-12-27Bug 697455: Make JPX support optional via configuration flag.Tor Andersson
Set FZ_ENABLE_JPX=0 in XCFLAGS or include/mupdf/fitz/config.h to disable support for JPX at compile time. Be aware that this may break support for PDF 1.5 and later files that need JPEG2000 support.
2016-12-27Strip extraneous blank lines.Tor Andersson
2016-12-27Common code to ensure we only premultiply pixmaps with additive colors.Tor Andersson
2016-12-14jpx: Delay determining if colorspace is indexed.Sebastian Rasmussen
2016-12-14jpx: Quietly limit number of components for openjpeg decoder.Sebastian Rasmussen
2016-12-14jpx: Create openjpeg decoder state.Sebastian Rasmussen
This allows for communicating the colorspace without using a pixmap.
2016-12-14jpx: Only do YCC-to-RGB conversion if decoding image samples.Sebastian Rasmussen
2016-12-14jpx: Optimize sample writing function.Sebastian Rasmussen
2016-12-14jpx: Delay reading metadata until parsing samples where possible.Sebastian Rasmussen
2016-12-14jpx: Only compute signed offsets once.Sebastian Rasmussen
2016-12-14jpx: Use local variables instead of repeatedly dereferencing state.Sebastian Rasmussen
2016-12-14jpx: Share YCC-to-RGB conversion for luratech/openjpeg decoders.Sebastian Rasmussen
2016-12-14jpx: Move state which is not shared among functions to decoder stack.Sebastian Rasmussen
In the case of fz_context *, use that for the allocator callbacks.
2016-12-14jpx: Use macro to check for palette.Sebastian Rasmussen
2016-12-14jpx: Max components is known, so avoid allocating arrays.Sebastian Rasmussen
2016-12-14jpx: Use fz_context directly, don't wrap it in state.Sebastian Rasmussen
2016-12-14jpx: Reuse structs for luratech/openjpeg decoders.Sebastian Rasmussen
2016-12-14jpx: Remove unused struct.Sebastian Rasmussen
2016-12-14jpx: Plug pixmap leak in case of error during decoding.Sebastian Rasmussen
2016-12-14Let pixmap colorspace conversion create new pixmap.Sebastian Rasmussen
This moves dropping the converted pixmap into fz_convert_pixmap(), which relieves every caller from doing so. Moreover resolution, position and interpolation are kept.