wget https://download.gimp.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2 tar xvf gegl-0.2.0.tar.bz2 && cd gegl-0.2.0
对源代码做点改动:
1 2
sed -i 's/CODEC_CAP_TRUNCATED/AV_CODEC_CAP_TRUNCATED/g' ./operations/external/ff-load.c sed -i 's/CODEC_FLAG_TRUNCATED/AV_CODEC_FLAG_TRUNCATED/g' ./operations/external/ff-load.c
/* read in the first tile offset. * if it is '0', then this tile level is empty * and we can simply return. */ info->cp += xcf_read_int32 (info->fp, &offset, 1); if (offset == 0) return TRUE;
/* Initialize the reference for the in-memory tile-compression */ previous = NULL;
ntiles = tiles->ntile_rows * tiles->ntile_cols; for (i = 0; i < ntiles; i++) { fail = FALSE;
if (offset == 0) { gimp_message_literal (info->gimp, G_OBJECT (info->progress), GIMP_MESSAGE_ERROR, "not enough tiles found in level"); return FALSE; }
/* save the current position as it is where the * next tile offset is stored. */ saved_pos = info->cp;
/* read in the offset of the next tile so we can calculate the amount of data needed for this tile*/ info->cp += xcf_read_int32 (info->fp, &offset2, 1);
/* if the offset is 0 then we need to read in the maximum possible allowing for negative compression */ if (offset2 == 0) offset2 = offset + TILE_WIDTH * TILE_WIDTH * 4 * 1.5; /* 1.5 is probably more than we need to allow */
/* seek to the tile offset */ if (! xcf_seek_pos (info, offset, NULL)) return FALSE;
/* get the tile from the tile manager */ tile = tile_manager_get (tiles, i, TRUE, TRUE);
/* read in the tile */ switch (info->compression) { case COMPRESS_NONE: if (!xcf_load_tile (info, tile)) fail = TRUE; break; case COMPRESS_RLE: if (!xcf_load_tile_rle (info, tile, offset2 - offset)) //问题在这 fail = TRUE; break; // ...