while (*y_start < y_end) {
int is_trans = 1;
for (int i = 0; i < w; i++) {
- if (buf[w * *y_start + i] != trans) {
+ if (buf[linesize * *y_start + i] != trans) {
is_trans = 0;
break;
}
}
// crop bottom
- while (y_end < h) {
+ while (y_end > *y_start) {
int is_trans = 1;
for (int i = 0; i < w; i++) {
- if (buf[w * y_end + i] != trans) {
+ if (buf[linesize * y_end + i] != trans) {
is_trans = 0;
break;
}
while (*x_start < x_end) {
int is_trans = 1;
for (int i = *y_start; i < y_end; i++) {
- if (buf[w * i + *x_start] != trans) {
+ if (buf[linesize * i + *x_start] != trans) {
is_trans = 0;
break;
}
}
// crop right
- while (x_end < w) {
+ while (x_end > *x_start) {
int is_trans = 1;
for (int i = *y_start; i < y_end; i++) {
- if (buf[w * i + x_end] != trans) {
+ if (buf[linesize * i + x_end] != trans) {
is_trans = 0;
break;
}
{ "gifflags", "set GIF flags", OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = GF_OFFSETTING|GF_TRANSDIFF}, 0, INT_MAX, FLAGS, "flags" },
{ "offsetting", "enable picture offsetting", 0, AV_OPT_TYPE_CONST, {.i64=GF_OFFSETTING}, INT_MIN, INT_MAX, FLAGS, "flags" },
{ "transdiff", "enable transparency detection between frames", 0, AV_OPT_TYPE_CONST, {.i64=GF_TRANSDIFF}, INT_MIN, INT_MAX, FLAGS, "flags" },
- { "gifimage", "enable encoding only images per frame", OFFSET(image), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS, "flags" },
+ { "gifimage", "enable encoding only images per frame", OFFSET(image), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
{ NULL }
};