Changeset 260


Ignore:
Timestamp:
Nov 1, 2008, 10:24:50 AM (13 years ago)
Author:
Eugene Romanenko
Message:

fixed thumbnail creation when plugin uses 32-bit pixbuffer

Location:
trunk/Lucide/SOURCE/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/lucidethumbs.cpp

    r230 r260  
    315315    strcat( tmpgif, "LUTHUMB.TMP" );
    316316
     317    // Workaround: GIF mmio proc hangs on 32-bit images, convert to 24 bit
     318    if ( bpp == 4 )
     319    {
     320        LuPixbuf *pb = new LuPixbuf( ev, rx, ry, 3 );
     321
     322        char *src = (char *)pixbuf->getDataPtr( ev );
     323        char *dst = (char *)pb->getDataPtr( ev );
     324        int src_rowstride = pixbuf->getRowSize( ev );
     325        int dst_rowstride = pb->getRowSize( ev );
     326
     327        int i, j, l, m;
     328        for ( i = 0; i < ry; i++ )
     329        {
     330            char *src_line = src + ( i * src_rowstride );
     331            char *dst_line = dst + ( i * dst_rowstride );
     332
     333            // source 4 Bpp, dest 3 Bpp
     334            for ( j = 0, l = 0, m = 0; j < rx; j++ ) {
     335                dst_line[ l++ ] = src_line[ m++ ];
     336                dst_line[ l++ ] = src_line[ m++ ];
     337                dst_line[ l++ ] = src_line[ m++ ];
     338                m++;
     339            }
     340        }
     341
     342        delete pixbuf;
     343        pixbuf = pb;
     344        bpp = 3;
     345    }
     346
    317347    bool saved = saveToImage( tmpgif, "GIFC", rx, ry, pixbuf->getRowSize( ev ),
    318348                              bpp * 8, (char *)pixbuf->getDataPtr( ev ) );
  • trunk/Lucide/SOURCE/gui/makefile

    r247 r260  
    22
    33TEST=0
    4 VERSION=1.20
     4VERSION=1.21
    55
    66!if $(TEST)==1
Note: See TracChangeset for help on using the changeset viewer.