When transparency is present, it's not enough to just write 32bpp samples.
One need to use the full BITMAPV3INFOHEADER syntax and specify the
masks for BGRA.
see https://en.wikipedia.org/wiki/BMP_file_format#Pixel_storage
Also remove the height-flip trick and write samples bottom-to-top instead.
Change-Id: If5d92c11453b96764b5bfbf19e9678e632bc911f
the container check may not be strictly necessary now that the alpha
check has matured and the library will detect usable alpha, but it's
safer to fix this case first before making larger changes.
Bug: webp:533
Change-Id: I2e1ba42156970d579a52bd183707a037e65fd900
replace with more inclusive terms or remove the comment entirely if the
meaning was already clear.
Bug: webp:507
Change-Id: Ica3bbf751ebf79f6668df6e6209af770248ff4ca
ICC extraction via GetColorContexts may fail due to the operation not
being supported with e.g., bitmaps.
Bug: webp:506
Change-Id: I587220e688ac90d77c84af21c9e7bc8bf178f3aa
Some PNG input contain chunks larger than libpng's default
memory-alloc limit (8M).
Raise this limit reasonably if it looks like the input bitstream
is larger than libpng's default limit.
BUG=webp:497
Change-Id: I2c9fbed727424042444b82cbf15e0781cefb38dc
Define macros in examples/unicode.h to use Unicode argv
on Windows. Keep char everywhere on Unix since it handles
UTF-8 without any change.
Impact:
- All fopen () and SHCreateStreamOnFile(),
- All fprintf() printing file paths,
- All strcmp() used with "-",
- File path parsing,
- Gif reading.
Concerned executables from examples/ and extras/:
anim_diff, anim_dump, vwebp, vwebp_sdl,
cwebp, dwebp, gif2webp, img2webp,
webpmux, webpinfo, webp_quality, get_disto
When compiled on Windows with Unicode enabled, webpmux and
img2webp will not work when used with an argument file and
will print "Reading arguments from a file is a feature
unavailable with Unicode binaries."
BUG=webp:398
Change-Id: Ic55d222a3ce1a715f9c4cce57ecbe2705d5ce317
after:
bc5092b1 pngdec: set memory functions
png_alloc_size_t was added in 1.4 use png_size_t in earlier versions
Change-Id: If65ac1c501e2d497b1be480095bf21f06ea7026a
use png_create_read_struct_2 to set a malloc function allowing the code
to fail on large allocations while fuzzing
Change-Id: Iaca1b93ecc6570067708f3ae2db07fbca74386ee
this quiets a -Wclobbered warning on const has_alpha under gcc-7 and
brings the variables closer to their first use.
Change-Id: I8a24f275b7ff34a94d47b576bcf276dbedac2121
Apply gamma correction to the decoded RGB values.
This handles corner cases where the PNG file doesn't have
a standard 1/2.2 gamma value.
BUG=webp:369
Change-Id: I9907b6e2c458002de7c26d0b9e416278cca33990
if a single text file name is supplied as argument
(e.g.: 'webpmux my_long_list_of_frames.txt'), the command
line arguments are actually parsed from this file.
Tokenizer will remove space, tabs, LF, CR, returns, etc.
+ changed ImgIoUtilReadFile() to return a null-terminated
data, for convenience.
+ misc clean-up in the code
BUG=webp:355
Change-Id: I76796305641d660933de5881763d723006712fa9
---
...prior to allocating a Picture. this is consistent with the other
readers and allows the allocation size to be limited at compile time
BUG=webp:355
Change-Id: Ib8e027ef863489b1e0f9e2a1403c3836da3ef48d
WEBP_MAX_IMAGE_SIZE can be defined to control this limit.
Set it to 1.5GiB w/--config=asan-fuzzer to avoid OOM with large resolution
images. This limit leaves some headroom over the single image max of 2^14 *
2^14 * 4
BUG=webp:355
Change-Id: I4d48eb0a063638297a842582e0229dfd5a54df5f
everything post jpeg decoder creation should go through the error path
to ensure it's cleaned up properly
Change-Id: If78b4529e40797c67c3d0e624af1c036badea674
this avoids setting bytes_per_px < depth causing an undersized
allocation for rgb import resulting in a crash.
BUG=b/37930872
Change-Id: I32a86f91528acc084a53d08c9fde9f2f1270a603
the TIFFGetField() return for TIFFTAG_EXTRASAMPLES is defined as (count,
types array) [1]. previously the count was being checked rather than the
first element of the array to determine whether the alpha was associated
(pre-multiplied) and the result needed to be unmultiplied.
since:
9273e441 fix TIFF encoder regarding rgbA/RGBA
[1] http://www.libtiff.org/man/TIFFSetField.3t.html
Change-Id: I6e41be9d038fe8afb6d0aa3c8048925dc901113b
Encoder:
We were always using ExtraSamples=1, which means associated-alpha.
But we don't need the (lossy) excursion to rgbA format. We can save
the samples as RGBA directly, by changing ExtraSamples to '2'.
The TIFF encoder now checks the colorspace properly, to handle
premultiplied format as well as non-premultiplied.
Decoder:
The result of TIFFReadRGBAImageOriented() is always pre-multiply.
So, in case an alpha channel is present, we need to unmultiply it before
calling WebPPictureImportRGBA().
See:
https://www.itu.int/itudoc/itu-t/com16/tiff-fx/docs/tiff6.pdf (page 31)
and also http://www.asmail.be/msg0055469184.html
Change-Id: I3258bfdb0eb2e1a53d6c04414f55edb2926c938c