Re: [5/5] gdiplus: Implement GdipImageSelectActiveFrame.

2012-06-19 Thread Dmitry Timoshkov
Vincent Povirk wrote: > > +if (stat == Ok) > > +{ > > +memcpy(&new_image->format, &codec->info.FormatID, sizeof(GUID)); > > +free_image_data(image); > > +if (image->type == ImageTypeBitmap) > > +*(GpBitmap *)image = *(GpBitmap *)new_image; > > +

Re: [5/5] gdiplus: Implement GdipImageSelectActiveFrame.

2012-06-19 Thread Vincent Povirk
>> Yes, but a non-bitmap (metafile) cannot have multiple frames. > > It actually can have records which represent embedded EMFs. Really? Well, OK then. > +if (stat == Ok) > +{ > +memcpy(&new_image->format, &codec->info.FormatID, sizeof(GUID)); > +free_image_data(image); >

Re: [5/5] gdiplus: Implement GdipImageSelectActiveFrame.

2012-06-19 Thread Dmitry Timoshkov
Vincent Povirk wrote: > >> Why did you re-implement move_bitmap() ? > > > > An image can be not a bitmap. > > Yes, but a non-bitmap (metafile) cannot have multiple frames. It actually can have records which represent embedded EMFs. -- Dmitry.

Re: [5/5] gdiplus: Implement GdipImageSelectActiveFrame.

2012-06-19 Thread Vincent Povirk
>> > +    if (stat == Ok) >> > +    { >> > +        memcpy(&new_image->format, &codec->info.FormatID, sizeof(GUID)); >> > +        free_image_data(image); >> > +        if (image->type == ImageTypeBitmap) >> > +            *(GpBitmap *)image = *(GpBitmap *)new_image; >> > +        else if (image->t

Re: [5/5] gdiplus: Implement GdipImageSelectActiveFrame.

2012-06-19 Thread Dmitry Timoshkov
Vincent Povirk wrote: > > +    hr = IStream_Clone(image->stream, &stream); > > +    if (FAILED(hr)) > > That's odd. When does that happen? IStream returned by SHCreateStreamOnFile (wrapped by GdipCreateStreamOnFile) intentionally doesn't implement Clone, there are even tests for that in shlwapi

Re: [5/5] gdiplus: Implement GdipImageSelectActiveFrame.

2012-06-19 Thread Vincent Povirk
> +    hr = IStream_Clone(image->stream, &stream); > +    if (FAILED(hr)) That's odd. When does that happen? > +    if (stat == Ok) > +    { > +        memcpy(&new_image->format, &codec->info.FormatID, sizeof(GUID)); > +        free_image_data(image); > +        if (image->type == ImageTypeBitmap