make this function return success/failure.
an empty map or out of bounds read is treated as an error.
BUG=webp:316
Change-Id: Ic8651836915ea4dd8e0dc81ca8d5d3f247be1ff8
This reverts commit f048d38d38.
the 'len' in Remap refers to the src[] not the colormap; this change
breaks valid files
BUG=webp:316
Change-Id: I1ed40075c2194df91d345cb6f29619b1f5cc96fc
Make WebPPictureDistortion() only compute distortion on A/R/G/B planes, not Y/U/V(A).
(not just for SSIM, but PSNR too).
This is to avoid problems with using SSIM on U/V channels.
If Y/U/V distortion is needed, one can always use WebPPlaneDistortion() individually.
Change-Id: If8bc9c3ac12a8d2220f03224694fc389b16b7da9
Also introduce an always-failing 'reader' for unknown formats.
So we don't have to check reader==NULL, code is more regular.
-> We can get read of specific ReadPNG(), ReadJPEG(), ... declaration and use.
Change-Id: I290759705420878f00c7223c726d4ad404afd9c4
- remove the inclusion of format_constants.h
- use incremental update of pointer, instead of arithmetic
(follow-up to e2affacc35)
Change-Id: I48420c8defc8d47339f54bc00e9da9617f08ab32
Mostly: avoid doing calculation like: ptr + j * stride
when stride is 'int'. Rather use size_t, or pointer increments (ptr += stride)
when possible.
BUG=webp:314
Change-Id: I81c684b515dd1ec4f601f32d50a6e821c4e46e20
DGifGetExtension() may successfully return, but the data pointer should
still be validated
BUG=webp:310
Change-Id: I6cfe617871fef2fe07887e5f48bb20f7ab7cfb35
quiets a -Wimplicit-function-declaration with some configurations of gcc
(-std=c99).
_POSIX_C_SOURCE is preferred over _BSD_SOURCE with newer versions of
glibc
Change-Id: I378bffb13ba52ff5c4bad1433090dcc387e5d507
The image is scaled to fit the whole viewport.
Avoid some oddities with offsets, etc.
removes some TODO.
Change-Id: I52fae9ca80a2feed234f32261c7f6358d7594e21
some multiplies here and there needed some extra checks
and error reporting. Even if width * height is guaranteed
to be < 2**32, we were multiplying by num_channels and
triggering a 32b overflow.
Some multiplies were not using size_t or uint64_t, additionally.
Change-Id: If2a35b94c8af204135f4b88a7fd63850aa381bbf
Change it from transparent white to transparent black, which matches
the transparent color assumed in Webp dispose-to-background method.
Also pre-multiply background colors before comparison in anim_diff,
just as what is done with regular pixel values.
Change-Id: I5a790522df21619c666ce499f73e42294ed276f2
decoding and file i/o have been split to imageio, all that remains is
some string routines used for parameter parsing in the examples
Change-Id: I77386cd8aa39124b9e14c95fdbaa17ea4ab5bb24
convert the assert() to an error check to avoid crashing when reading
malformed files.
BUG=webp:302
Change-Id: I25eed9cab5c0a439bd3411beacc83f3a27af2bbf
-> WebPImageReader
Introduce a variant of image-guessing function that returns a reader
directly: WebPGuessImageReader()
Change-Id: I5ddc53024fcf941e33d997b2be6aa1a963d939ab
adds a generic examples/image_dec.[ch] entry point too.
WebPGuessImageType() can be used to infer image type.
Change-Id: I8337e7b6ad91863c9cf118e4791668d2d175079b
After the introduction of lossy frame rectangles
we need equivalent option in anim_diff for merging similar frames.
Change-Id: I1d03acace396ec4cb0212586c6e8b8ec5b0b0bfc
If value is '2', it means the buffer is a 'slow' one, like GPU-mapped memory.
This change is backward compatible (setting is_external_memory to 2
will be a no-op in previous libraries)
dwebp: add flags to force a particular colorspace format
new flags is:
-pixel_format {RGB,RGBA,BGR,BGRA,ARGB,RGBA_4444,RGB_565,
rgbA,bgrA,Argb,rgbA_4444,YUV,YUVA}
and also,external_memory {0,1,2}
These flags are mostly for debuggging purpose, and hence are not documented.
Change-Id: Iac88ce1e10b35163dd7af57f9660f062f5d8ed5e
This is to prevent users shooting in the foot using -psnr or
-size alone and not getting the expected result.
Change-Id: I67a3289e4ec0a2a813c98807f2ec5e600f52dc63
though visible WebPCopyPlane & WebPCopyPixels are not part of the public
api; avoid using a private header within this public module.
Change-Id: I5c8615fcc07090ffaa8933b00af418d8431936eb