gdiplus: Fix GdipImageRotateFlip for images from streams.

This commit is contained in:
Vincent Povirk 2012-07-12 09:17:09 -05:00 committed by Alexandre Julliard
parent c5820b7910
commit 577740f0d7
2 changed files with 17 additions and 2 deletions

View File

@ -1971,8 +1971,6 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette)
{ {
assert(src->image.type == ImageTypeBitmap); assert(src->image.type == ImageTypeBitmap);
assert(dst->image.type == ImageTypeBitmap); assert(dst->image.type == ImageTypeBitmap);
assert(src->image.stream == NULL);
assert(dst->image.stream == NULL);
GdipFree(dst->bitmapbits); GdipFree(dst->bitmapbits);
DeleteDC(dst->hdc); DeleteDC(dst->hdc);
@ -2001,6 +1999,12 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette)
if (dst->metadata_reader) if (dst->metadata_reader)
IWICMetadataReader_Release(dst->metadata_reader); IWICMetadataReader_Release(dst->metadata_reader);
dst->metadata_reader = src->metadata_reader; dst->metadata_reader = src->metadata_reader;
if (dst->image.stream)
IStream_Release(dst->image.stream);
dst->image.stream = src->image.stream;
dst->image.frame_count = src->image.frame_count;
dst->image.current_frame = src->image.current_frame;
dst->image.format = src->image.format;
src->image.type = ~0; src->image.type = ~0;
GdipFree(src); GdipFree(src);

View File

@ -2345,6 +2345,17 @@ static void test_multiframegif(void)
expect(Ok, stat); expect(Ok, stat);
expect(0xffffffff, color); expect(0xffffffff, color);
/* rotate/flip discards the information about other frames */
stat = GdipImageRotateFlip((GpImage*)bmp, Rotate90FlipNone);
expect(Ok, stat);
count = 12345;
stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count);
expect(Ok, stat);
expect(1, count);
expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bmp, __LINE__, FALSE);
GdipDisposeImage((GpImage*)bmp); GdipDisposeImage((GpImage*)bmp);
IStream_Release(stream); IStream_Release(stream);