1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
diff -rupN a/contrib/isf-qt/src/isfqt.cpp b/contrib/isf-qt/src/isfqt.cpp
--- a/contrib/isf-qt/src/isfqt.cpp 2012-02-18 16:28:01.000000000 +0000
+++ b/contrib/isf-qt/src/isfqt.cpp 2013-07-30 20:51:06.705394145 +0000
@@ -484,12 +484,13 @@ QByteArray Stream::writerGif( const Draw
int width = isfImage.width();
int numColors = 0;
bool gifError = true;
+ int gifErrCode;
// Convert the image to GIF using libgif
// Open the gif file
gifData.open( QIODevice::WriteOnly );
- gifImage = EGifOpen( (void*)&gifData, GifWriteToByteArray );
+ gifImage = EGifOpen( (void*)&gifData, GifWriteToByteArray, &gifErrCode );
if( gifImage == 0 )
{
qWarning() << "Couldn't initialize gif library!";
@@ -503,7 +504,7 @@ QByteArray Stream::writerGif( const Draw
numColors = 256;
}
- cmap = MakeMapObject( numColors, NULL );
+ cmap = GifMakeMapObject( numColors, NULL );
if( cmap == 0 && isfImage.numColors() > 1 )
{
qWarning() << "Couldn't create map object for gif conversion (colors:" << isfImage.numColors() << ")!";
@@ -576,7 +577,7 @@ QByteArray Stream::writerGif( const Draw
else
{
// Write the extension
- if( EGifPutExtensionFirst( gifImage, COMMENT_EXT_FUNC_CODE, MAX_GIF_BYTE, isfData.left( MAX_GIF_BYTE ).data() ) == GIF_ERROR )
+ if( EGifPutExtensionLeader( gifImage, COMMENT_EXT_FUNC_CODE) == GIF_ERROR )
{
qWarning() << "EGifPutExtensionFirst failed!";
goto writeError;
@@ -590,9 +591,9 @@ QByteArray Stream::writerGif( const Draw
// Write all the full data blocks
while( length >= MAX_GIF_BYTE )
{
- if( EGifPutExtensionNext( gifImage, 0, MAX_GIF_BYTE, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR )
+ if( EGifPutExtensionBlock( gifImage, MAX_GIF_BYTE, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR )
{
- qWarning() << "EGifPutExtensionNext failed!";
+ qWarning() << "EGifPutExtensionBlock failed!";
goto writeError;
}
@@ -603,17 +604,17 @@ QByteArray Stream::writerGif( const Draw
// Write the last block
if( length > 0 )
{
- if( EGifPutExtensionLast( gifImage, 0, length, isfData.mid( pos, MAX_GIF_BYTE ).data() ) == GIF_ERROR )
+ if( EGifPutExtensionTrailer( gifImage ) == GIF_ERROR )
{
- qWarning() << "EGifPutExtensionLast (n) failed!";
+ qWarning() << "EGifPutExtensionTrailer (n) failed!";
goto writeError;
}
}
else
{
- if( EGifPutExtensionLast( gifImage, 0, 0, 0 ) == GIF_ERROR )
+ if( EGifPutExtensionTrailer( gifImage ) == GIF_ERROR )
{
- qWarning() << "EGifPutExtensionLast (0) failed!";
+ qWarning() << "EGifPutExtensionTrailer (0) failed!";
goto writeError;
}
}
@@ -624,12 +625,12 @@ QByteArray Stream::writerGif( const Draw
writeError:
// Clean up the GIF converter etc
EGifCloseFile( gifImage );
- FreeMapObject( cmap );
+ GifFreeMapObject( cmap );
gifData.close();
if( gifError )
{
- qWarning() << "GIF error code:" << GifLastError();
+ qWarning() << "GIF error code:" << GifErrorString(gifErrCode);
}
else
{
|