forked from old/legacy-imlib2
Thu Apr 27 04:00:28 GMT 2000
(gilbertt) All done except the tiff loader. (Although I may be giving back incomplete rows on a couple, I have to test more). The tiff loader is gonna be hard, libtiff is quite broken in many ways ;-) SVN revision: 2549
This commit is contained in:
parent
ceec186cb7
commit
0a7de7daf5
|
@ -2882,3 +2882,12 @@ Wed Apr 26 19:58:05 PDT 2000
|
|||
|
||||
If progress() returns 0, clip the last row and
|
||||
return 2.
|
||||
|
||||
_______________________________________________
|
||||
|
||||
Thu Apr 27 04:00:28 GMT 2000
|
||||
(gilbertt)
|
||||
|
||||
All done except the tiff loader. This one is gonna be hard. Libtiff is quite
|
||||
broken in many ways ;-)
|
||||
|
||||
|
|
|
@ -97,7 +97,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -155,8 +159,16 @@ save (ImlibImage *im, ImlibProgressFunction progress,
|
|||
if (((per - pper) >= progress_granularity) ||
|
||||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
l = y - pl;
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
if (buf)
|
||||
free(buf);
|
||||
#endif
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
|
|
@ -302,7 +302,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -334,7 +338,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -422,7 +430,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -449,7 +461,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -478,7 +494,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -505,7 +525,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -534,7 +558,11 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l);
|
||||
if(!progress(im, per, 0, im->h - y - 1, im->w, im->h - y + l))
|
||||
{
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -550,6 +578,7 @@ char
|
|||
save (ImlibImage *im, ImlibProgressFunction progress,
|
||||
char progress_granularity)
|
||||
{
|
||||
/* TODO */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,14 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
((h - l) <= cinfo.rec_outbuf_height))
|
||||
{
|
||||
count = per;
|
||||
progress(im, per, 0, prevy, w, scans + l - prevy);
|
||||
if(!progress(im, per, 0, prevy, w, scans + l - prevy))
|
||||
{
|
||||
free(data);
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
prevy = l + scans;
|
||||
}
|
||||
}
|
||||
|
@ -201,7 +208,14 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
((h - l) <= cinfo.rec_outbuf_height))
|
||||
{
|
||||
count = per;
|
||||
progress(im, per, 0, prevy, w, l + scans - prevy);
|
||||
if(!progress(im, per, 0, prevy, w, l + scans - prevy))
|
||||
{
|
||||
free(data);
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
prevy = l + scans;
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +320,13 @@ save (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
jpeg_finish_compress(&cinfo);
|
||||
free(buf);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
|
|
@ -197,8 +197,14 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
}
|
||||
}
|
||||
}
|
||||
if (progress)
|
||||
progress(im, per, 0, prevy, w, y - prevy + 1);
|
||||
if ((progress) && (!progress(im, per, 0, prevy, w, y - prevy + 1)))
|
||||
{
|
||||
free(lines);
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
free(line);
|
||||
}
|
||||
|
@ -224,11 +230,25 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
if ((per - count) >= progress_granularity)
|
||||
{
|
||||
count = per;
|
||||
progress(im, per, 0, prevy, w, y - prevy + 1);
|
||||
if(!progress(im, per, 0, prevy, w, y - prevy + 1))
|
||||
{
|
||||
free(lines);
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
prevy = y + 1;
|
||||
}
|
||||
}
|
||||
progress(im, per, 0, prevy, w, y - prevy + 1);
|
||||
if(!progress(im, per, 0, prevy, w, y - prevy + 1))
|
||||
{
|
||||
free(lines);
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -332,7 +352,15 @@ save (ImlibImage *im, ImlibProgressFunction progress,
|
|||
if ((per - pper) >= progress_granularity)
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
png_write_end(png_ptr, info_ptr);
|
||||
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
|
|
@ -233,7 +233,13 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -291,7 +297,13 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -339,7 +351,13 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -397,7 +415,13 @@ load (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
if (data)
|
||||
free(data);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -471,7 +495,12 @@ save (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
free(buf);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
@ -515,7 +544,12 @@ save (ImlibImage *im, ImlibProgressFunction progress,
|
|||
(y == (im->h - 1)))
|
||||
{
|
||||
l = y - pl;
|
||||
progress(im, per, 0, (y - l), im->w, l);
|
||||
if(!progress(im, per, 0, (y - l), im->w, l))
|
||||
{
|
||||
free(buf);
|
||||
fclose(f);
|
||||
return 1;
|
||||
}
|
||||
pper = per;
|
||||
pl = y;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue