diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp index 22a6f09..7190750 100644 --- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp +++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp @@ -29,6 +29,8 @@ #if PLATFORM(CAIRO) || PLATFORM(QT) || PLATFORM(WX) +#define NO_ANIMATED_GIF 1 + namespace WebCore { class GIFImageDecoderPrivate @@ -144,7 +146,11 @@ int GIFImageDecoder::frameCount() m_frameBufferCache.resize(reader.frameCount()); } +#ifdef NO_ANIMATED_GIF + return std::min((int)m_frameBufferCache.size(), 1); +#else return m_frameBufferCache.size(); +#endif } // The number of repetitions to perform for an animation loop. @@ -157,9 +163,13 @@ int GIFImageDecoder::repetitionCount() const // responsible for waiting until image decoding has finished to ask this if // it needs an authoritative answer. In the meantime, we should default to // "loop once", both in the reader and here. +#ifdef NO_ANIMATED_GIF + return cAnimationLoopOnce; +#else if (m_reader) m_repetitionCount = m_reader->repetitionCount(); return m_repetitionCount; +#endif } RGBA32Buffer* GIFImageDecoder::frameBufferAtIndex(size_t index)