Commit graph

70 commits

Author SHA1 Message Date
Alex Musolino 404c901f29 ico: avoid potential nil pointer dereferences
Bgeticon can fail, leaving the Icon img pointers nil.
2020-12-15 20:45:26 +10:30
Alex Musolino 81647c2025 ico: fix interpretation of 0 widths/heights 2020-12-15 20:44:11 +10:30
Alex Musolino 51b22d8548 jpg: treat EOF as EOI marker
Some jpegs, rightly or wrongly, do not contain an EOI marker.  This
causes jpg(1) to bail out even after correctly parsing the entire
image.
2020-10-31 15:44:49 +10:30
Alex Musolino e6bfbd0d33 png: remove bogus chanlen warning 2020-09-01 21:54:10 +09:30
ftrvxmtrx 0930f44feb cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
cinap_lenrek a8d00e5d56 gif: just read and decode the first image when -9 or -c flag is specified 2016-10-22 00:35:17 +02:00
aiju e73a9eb9e8 togif: -E flag to read animation from stdin 2016-06-10 12:14:02 +02:00
cinap_lenrek b6b5fd6da7 jpg: output partial image data when available (truncated files) 2016-05-16 05:35:22 +02:00
BurnZeZ 455a0a09ac jpg: fd == 0 is valid, so don't ignore it 2016-04-06 20:22:42 -04:00
cinap_lenrek 772afbe98c format pointer subtraction results with %zd instead of %ld (for long -> intptr on amd64) 2016-01-07 04:44:13 +01:00
cinap_lenrek 0140f20af4 jpg/ico: fix mkfile 2015-08-01 11:56:01 +02:00
cinap_lenrek 69daa9fd96 jpg/ico: support for embedded png icons 2015-07-31 12:58:58 +02:00
cinap_lenrek a44a1dbd19 gif: fix color table clipping (for cb5.gif) 2015-03-11 12:59:19 +01:00
cinap_lenrek d7a4fdee99 jpg: handle progressive non-interleaved mode 2015-02-23 01:20:42 +01:00
ftrvxmtrx 0dc1929379 png: fail on invalid bpc 2014-12-14 22:20:06 +01:00
ftrvxmtrx 96525edaae various cmds: replace magic numbers with Kdel/Keof, etc 2014-12-13 21:58:49 +01:00
cinap_lenrek 797cc13c70 fix dangerous werrstr() usages
werrstr() takes a format string as its first argument.
a common error is to pass user controlled string buffers
into werrstr() that might contain format string escapes
causing werrstr() to take bogus arguments from the stack
and crash.

so instead of doing:
	werrstr(buf);

we want todo:
	werrstr("%s", buf);

or if we have a local ERRMAX sized buffer that we can override:
	errstr(buf, sizeof buf);
2014-11-07 12:51:59 +01:00
cinap_lenrek 7af85b9e74 jpg: center image in screen
when using the jpg(1) programs interactively, draw the
image in the center of it. this avoids wasting space
with always on borders on small windows and looks better
when used in fullscreen.
2014-02-08 02:33:29 +01:00
cinap_lenrek e2da074d28 gif: remove warning when animated gif is rendered to bitmap 2013-12-07 00:53:01 +01:00
cinap_lenrek 4a9f900726 mkfiles: do not rely on path containing the . element
when executing generated binaries and helper scripts,
always execute them as ./name instead of relying that
path contsins the dot.
2013-10-26 20:22:01 +02:00
ppatience0 243cb68011 jpg(1), jpg: add -y flag to usage
png: colorspace will never be CYCbCr (this is no
doubt from copy-pasting from jpg)

tif: everyone else uses colorspace as a function
argument, so we will too

readtif, writetif: credit paul bourke
2013-08-31 13:39:51 -04:00
ppatience0 776056dcd0 readtif, writetif: remove multiplication in inner loops of predict functions 2013-07-21 10:56:11 -04:00
ppatience0 61c82d2bb8 readtif: simplify rounding in other places 2013-07-20 18:19:20 -04:00
ppatience0 171db68c3d readtif, writetif: simplify rounding 2013-07-20 18:00:34 -04:00
ppatience0 0fc3aa99a1 readtif: if getbit returns less than 0 during eol fill bits, return early 2013-07-20 16:56:29 -04:00
ppatience0 92b14e72b0 readtif, writetif: prevent buffer overflows in some corner cases 2013-07-20 16:42:33 -04:00
ppatience0 105155880c tojpg, totif: change flags to better match those of the decoders 2013-07-20 12:11:52 -04:00
ppatience0 360cabb858 readtif: fix many bugs
totif: add tiff encoder
2013-07-19 02:16:43 -04:00
ppatience0 24a5720bec writejpg: the call to Bflush() is unnecessary; free data before exiting in case of malloc error
writeppm: do not print a space after the last pixel
2013-07-19 01:07:15 -04:00
ppatience0 cbf6be5bae tif: initialize max to one instead of zero for palette rescaling in case all values are zero. 2013-07-03 21:08:13 -04:00
ppatience0 e6b647e8ec tif: rescale palette color map to [0, 255] 2013-07-03 20:49:33 -04:00
ppatience0 043c8e4453 tif: add tiff decoder 2013-07-02 01:57:14 -04:00
ppatience0 74416281b0 readgif, readjpg: fix incorrect malloc arguments: use sizeof(Rawimage*) instead of sizeof(Rawimage**) and 2*sizeof(Rawimage*) instead of sizeof(Header)
readtga: switch calloc arguments: nelem is supposed to first, elsize second
2013-06-01 17:14:50 -04:00
ppatience0 ffef3278ef tojpg: GREY[1248] images should be grayscale 2013-05-27 19:32:28 -04:00
ppatience0 410ce8feec tojpg: add jpeg encoder 2013-05-26 21:56:56 -04:00
ppatience0 7b4c8aac93 toppm: no need to initialize err 2013-05-12 18:00:47 -04:00
ppatience0 03d1d83deb toppm: checking for err is useless; it was initialized to nil earlier 2013-05-12 17:52:35 -04:00
ppatience0 df25791b33 toppm: multichan converts to RGB24, not RGBV 2013-05-12 17:46:39 -04:00
ppatience0 eee0141465 writeppm: replace WriteGIF by WritePPM 2013-05-12 17:08:52 -04:00
cinap_lenrek 6bcc1eb399 writeppm: simplify 2013-05-13 23:03:23 +02:00
ppatience0 a3f776a13e writeppm: for bitmaps, 1 is black, 0 is white 2013-05-12 16:36:29 -04:00
ppatience0 a1130d843d toppm: fix style 2013-05-12 16:17:09 -04:00
ppatience0 d5e3e4326c toppm: add -r flag for raw ppm 2013-05-12 16:11:43 -04:00
cinap_lenrek b78e9525cf writeppm: fix tab/spaces 2013-05-12 19:12:21 +02:00
ppatience0 1d760c9b3e file: recognize bitmap and graymap ppm images
writeppm: do not print extra space after each pixel for graymap formats to save space
2013-05-12 12:53:43 -04:00
cinap_lenrek 358f72266a merge 2013-01-25 14:20:53 +01:00
cinap_lenrek ea81146c15 jpg: check read count when reading png magic (harmless) 2013-01-25 14:14:31 +01:00
ftrvxmtrx e00c53cf74 tga, file: 15-bit tga images 2013-01-24 22:10:27 +01:00
ftrvxmtrx 8e7a00e143 tga: fix flip/reflect 2013-01-22 17:02:31 +01:00
cinap_lenrek e18b9f6fd2 tga: fix bad output channel descriptor for grayscale images and -9 flag, revert page work arround 2013-01-21 11:09:47 +01:00