forked from old/legacy-imlib2
Thu Apr 27 13:43:49 GMT 2000
(gilbertt) Actually, made the gif loader give back what it's got without changing im->h to reflect, or reallocing the image data. The reason for this is that it already told apps what the image size was in the first progressive loader callback, and changing it afterwards can cause confusion. Also, an app can still handle/display a half-loaded image, as the rest is just filled black, and the programmer knows how much of the image he got, 'cos he interrupted it from the callback. If the programmer wants to trim the image, he knows where to trim it, but if he/she wants to display a part-loaded image, that'll work sanely. I think this is more sane behaviour, having tested it in feh and imlib2_view, but feel free to disagree ;-) SVN revision: 2561
This commit is contained in:
parent
be906e1416
commit
1f9025dd97
18
ChangeLog
18
ChangeLog
|
@ -2905,3 +2905,21 @@ Thu Apr 27 13:41:11 GMT 2000
|
|||
|
||||
Free up some RAM and close the filehandle when interrupted.
|
||||
|
||||
_______________________________________________
|
||||
|
||||
Thu Apr 27 13:43:49 GMT 2000
|
||||
(gilbertt)
|
||||
|
||||
Actually, made the gif loader give back what it's got without changing im->h
|
||||
to reflect, or reallocing the image data. The reason for this is that it
|
||||
already told apps what the image size was in the first progressive loader
|
||||
callback, and changing it afterwards can cause confusion. Also, an app can
|
||||
still handle/display a half-loaded image, as the rest is just filled black,
|
||||
and the programmer knows how much of the image he got, 'cos he interrupted
|
||||
it from the callback. If the programmer wants to trim the image, he knows
|
||||
where to trim it, but if he/she wants to display a part-loaded image,
|
||||
that'll work sanely.
|
||||
|
||||
I think this is more sane behaviour, having tested it in feh and
|
||||
imlib2_view, but feel free to disagree ;-)
|
||||
|
||||
|
|
|
@ -150,10 +150,6 @@ load(ImlibImage *im, ImlibProgressFunction progress, char progress_granularity,
|
|||
if (progress && (((int) per) != last_per) && (((int) per) % progress_granularity == 0)) {
|
||||
last_per = (int) per;
|
||||
if (!(progress(im, (int) per, 0, last_y, w, i))) {
|
||||
/* Early termination. Give back everything but
|
||||
the current row, since it's incomplete. */
|
||||
im->data = (DATA32 *) realloc(im->data, sizeof(DATA32) * w * i);
|
||||
im->h = i;
|
||||
DGifCloseFile(gif);
|
||||
for (i = 0; i < h; i++) {
|
||||
free(rows[i]);
|
||||
|
|
Loading…
Reference in New Issue