Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
f78a6dd1
Commit
f78a6dd1
authored
Jul 13, 2015
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jul 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Move the burden of supporting GIF encoding to the WIC backend.
parent
d57b87c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
2 deletions
+94
-2
image.c
dlls/gdiplus/image.c
+8
-2
image.c
dlls/gdiplus/tests/image.c
+86
-0
No files found.
dlls/gdiplus/image.c
View file @
f78a6dd1
...
...
@@ -4401,6 +4401,12 @@ static GpStatus encode_image_jpeg(GpImage *image, IStream* stream,
return
encode_image_wic
(
image
,
stream
,
&
GUID_ContainerFormatJpeg
,
params
);
}
static
GpStatus
encode_image_gif
(
GpImage
*
image
,
IStream
*
stream
,
GDIPCONST
CLSID
*
clsid
,
GDIPCONST
EncoderParameters
*
params
)
{
return
encode_image_wic
(
image
,
stream
,
&
CLSID_WICGifEncoder
,
params
);
}
/*****************************************************************************
* GdipSaveImageToStream [GDIPLUS.@]
*/
...
...
@@ -4611,14 +4617,14 @@ static const struct image_codec codecs[NUM_CODECS] = {
/* FormatDescription */
gif_format
,
/* FilenameExtension */
gif_extension
,
/* MimeType */
gif_mimetype
,
/* Flags */
ImageCodecFlagsDecoder
|
ImageCodecFlagsSupportBitmap
|
ImageCodecFlagsBuiltin
,
/* Flags */
ImageCodecFlagsDecoder
|
ImageCodecFlags
Encoder
|
ImageCodecFlags
SupportBitmap
|
ImageCodecFlagsBuiltin
,
/* Version */
1
,
/* SigCount */
2
,
/* SigSize */
6
,
/* SigPattern */
gif_sig_pattern
,
/* SigMask */
gif_sig_mask
,
},
NULL
,
encode_image_gif
,
decode_image_gif
,
select_frame_gif
},
...
...
dlls/gdiplus/tests/image.c
View file @
f78a6dd1
...
...
@@ -4544,6 +4544,91 @@ static void test_CloneBitmapArea(void)
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
static
BOOL
get_encoder_clsid
(
LPCWSTR
mime
,
GUID
*
format
,
CLSID
*
clsid
)
{
GpStatus
status
;
UINT
n_codecs
,
info_size
,
i
;
ImageCodecInfo
*
info
;
BOOL
ret
=
FALSE
;
status
=
GdipGetImageEncodersSize
(
&
n_codecs
,
&
info_size
);
expect
(
Ok
,
status
);
info
=
GdipAlloc
(
info_size
);
status
=
GdipGetImageEncoders
(
n_codecs
,
info_size
,
info
);
expect
(
Ok
,
status
);
for
(
i
=
0
;
i
<
n_codecs
;
i
++
)
{
if
(
!
lstrcmpW
(
info
[
i
].
MimeType
,
mime
))
{
*
format
=
info
[
i
].
FormatID
;
*
clsid
=
info
[
i
].
Clsid
;
ret
=
TRUE
;
break
;
}
}
GdipFree
(
info
);
return
ret
;
}
static
void
test_supported_encoders
(
void
)
{
static
const
WCHAR
bmp_mimetype
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'b'
,
'm'
,
'p'
,
0
};
static
const
WCHAR
jpeg_mimetype
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'j'
,
'p'
,
'e'
,
'g'
,
0
};
static
const
WCHAR
gif_mimetype
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'g'
,
'i'
,
'f'
,
0
};
static
const
WCHAR
tiff_mimetype
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
't'
,
'i'
,
'f'
,
'f'
,
0
};
static
const
WCHAR
png_mimetype
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'p'
,
'n'
,
'g'
,
0
};
static
const
struct
test_data
{
LPCWSTR
mime
;
const
GUID
*
format
;
BOOL
todo
;
}
td
[]
=
{
{
bmp_mimetype
,
&
ImageFormatBMP
,
FALSE
},
{
jpeg_mimetype
,
&
ImageFormatJPEG
,
FALSE
},
{
gif_mimetype
,
&
ImageFormatGIF
,
TRUE
},
{
tiff_mimetype
,
&
ImageFormatTIFF
,
FALSE
},
{
png_mimetype
,
&
ImageFormatPNG
,
FALSE
}
};
GUID
format
,
clsid
;
BOOL
ret
;
HRESULT
hr
;
GpStatus
status
;
GpBitmap
*
bm
;
IStream
*
stream
;
HGLOBAL
hmem
;
int
i
;
status
=
GdipCreateBitmapFromScan0
(
1
,
1
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
ok
(
status
==
Ok
,
"GdipCreateBitmapFromScan0 error %d
\n
"
,
status
);
for
(
i
=
0
;
i
<
sizeof
(
td
)
/
sizeof
(
td
[
0
]);
i
++
)
{
ret
=
get_encoder_clsid
(
td
[
i
].
mime
,
&
format
,
&
clsid
);
ok
(
ret
,
"%s encoder is not in the list
\n
"
,
wine_dbgstr_w
(
td
[
i
].
mime
));
expect_guid
(
td
[
i
].
format
,
&
format
,
__LINE__
,
FALSE
);
hmem
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_NODISCARD
,
16
);
hr
=
CreateStreamOnHGlobal
(
hmem
,
TRUE
,
&
stream
);
ok
(
hr
==
S_OK
,
"CreateStreamOnHGlobal error %#x
\n
"
,
hr
);
status
=
GdipSaveImageToStream
((
GpImage
*
)
bm
,
stream
,
&
clsid
,
NULL
);
if
(
td
[
i
].
todo
)
todo_wine
ok
(
status
==
Ok
,
"GdipSaveImageToStream error %d
\n
"
,
status
);
else
ok
(
status
==
Ok
,
"GdipSaveImageToStream error %d
\n
"
,
status
);
IStream_Release
(
stream
);
}
GdipDisposeImage
((
GpImage
*
)
bm
);
}
START_TEST
(
image
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -4556,6 +4641,7 @@ START_TEST(image)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_supported_encoders
();
test_CloneBitmapArea
();
test_ARGB_conversion
();
test_DrawImage_scale
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment