gd_gif_out.c (libgd-2.3.2) | : | gd_gif_out.c (libgd-2.3.3) | ||
---|---|---|---|---|
skipping to change at line 738 | skipping to change at line 738 | |||
break_top: | break_top: | |||
if (tim->sy == min_y) { | if (tim->sy == min_y) { | |||
/* No changes in this frame!! Encode empty image. */ | /* No changes in this frame!! Encode empty image. */ | |||
transparent = 0; | transparent = 0; | |||
min_x = min_y = 1; | min_x = min_y = 1; | |||
max_x = max_y = 0; | max_x = max_y = 0; | |||
} else { | } else { | |||
/* Then the bottom row */ | /* Then the bottom row */ | |||
for (y = tim->sy - 1; y > min_y; --y) { | for (y = tim->sy - 1; y > min_y; --y) { | |||
for (x = 0; x < tim->sx; ++x) { | for (x = 0; x < tim->sx; ++x) { | |||
if (!gdImageBoundsSafe(prev_tim, x,y)) | ||||
continue; | ||||
if (!comparewithmap | if (!comparewithmap | |||
(prev_tim, tim, | (prev_tim, tim, | |||
prev_tim->pixels[y][x], | prev_tim->pixels[y][x], | |||
tim->pixels[y][x], | tim->pixels[y][x], | |||
colorMap)) { | colorMap)) { | |||
max_y = y; | max_y = y; | |||
if(x < min_x) { | if(x < min_x) { | |||
min_x = x; | min_x = x; | |||
} | } | |||
if(x > max_x) { | if(x > max_x) { | |||
skipping to change at line 759 | skipping to change at line 761 | |||
} | } | |||
goto break_bot; | goto break_bot; | |||
} | } | |||
} | } | |||
} | } | |||
break_bot: | break_bot: | |||
/* left side */ | /* left side */ | |||
for (x = 0; x < min_x; ++x) { | for (x = 0; x < min_x; ++x) { | |||
for (y = min_y; y <= max_y; ++y) { | for (y = min_y; y <= max_y; ++y) { | |||
if (!gdImageBoundsSafe(prev_tim, x,y)) | ||||
continue; | ||||
if (!comparewithmap | if (!comparewithmap | |||
(prev_tim, tim, | (prev_tim, tim, | |||
prev_tim->pixels[y][x], | prev_tim->pixels[y][x], | |||
tim->pixels[y][x], | tim->pixels[y][x], | |||
colorMap)) { | colorMap)) { | |||
min_x = x; | min_x = x; | |||
goto break_left; | goto break_left; | |||
} | } | |||
} | } | |||
} | } | |||
break_left: | break_left: | |||
/* right side */ | /* right side */ | |||
for (x = tim->sx - 1; x > max_x; --x) { | for (x = tim->sx - 1; x > max_x; --x) { | |||
for (y = min_y; y <= max_y; ++y) { | for (y = min_y; y <= max_y; ++y) { | |||
if (!gdImageBoundsSafe(prev_tim, x,y)) | ||||
continue; | ||||
if (!comparewithmap | if (!comparewithmap | |||
(prev_tim, tim, | (prev_tim, tim, | |||
prev_tim->pixels[y][x], | prev_tim->pixels[y][x], | |||
tim->pixels[y][x], | tim->pixels[y][x], | |||
colorMap)) { | colorMap)) { | |||
max_x = x; | max_x = x; | |||
goto break_right; | goto break_right; | |||
} | } | |||
} | } | |||
} | } | |||
skipping to change at line 847 | skipping to change at line 853 | |||
} | } | |||
} | } | |||
BitsPerPixel = colorstobpp(tim->colorsTotal); | BitsPerPixel = colorstobpp(tim->colorsTotal); | |||
/* All set, let's do it. */ | /* All set, let's do it. */ | |||
GIFAnimEncode( | GIFAnimEncode( | |||
out, tim->sx, tim->sy, LeftOfs, TopOfs, interlace, transparent, | out, tim->sx, tim->sy, LeftOfs, TopOfs, interlace, transparent, | |||
Delay, Disposal, BitsPerPixel, | Delay, Disposal, BitsPerPixel, | |||
LocalCM ? tim->red : 0, tim->green, tim->blue, tim); | LocalCM ? tim->red : 0, tim->green, tim->blue, tim); | |||
if(pim) { | ||||
/* Destroy palette based temporary image. */ | ||||
gdImageDestroy(pim); | ||||
} | ||||
return 0; | return 0; | |||
fail_end: | fail_end: | |||
if(pim) { | if(pim) { | |||
/* Destroy palette based temporary image. */ | /* Destroy palette based temporary image. */ | |||
gdImageDestroy(pim); | gdImageDestroy(pim); | |||
} | } | |||
return 1; | return 1; | |||
} | } | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added |