Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
6f630a40
Commit
6f630a40
authored
Aug 20, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: GdipGetImageThumbnail should return image in 32bppPARGB format.
parent
62724c9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
1 deletion
+80
-1
image.c
dlls/gdiplus/image.c
+1
-1
image.c
dlls/gdiplus/tests/image.c
+79
-0
No files found.
dlls/gdiplus/image.c
View file @
6f630a40
...
@@ -4393,7 +4393,7 @@ GpStatus WINGDIPAPI GdipGetImageThumbnail(GpImage *image, UINT width, UINT heigh
...
@@ -4393,7 +4393,7 @@ GpStatus WINGDIPAPI GdipGetImageThumbnail(GpImage *image, UINT width, UINT heigh
GdipGetImageWidth
(
image
,
&
srcwidth
);
GdipGetImageWidth
(
image
,
&
srcwidth
);
GdipGetImageHeight
(
image
,
&
srcheight
);
GdipGetImageHeight
(
image
,
&
srcheight
);
stat
=
GdipCreateBitmapFromScan0
(
width
,
height
,
0
,
PixelFormat32bppARGB
,
stat
=
GdipCreateBitmapFromScan0
(
width
,
height
,
0
,
PixelFormat32bpp
P
ARGB
,
NULL
,
(
GpBitmap
**
)
ret_image
);
NULL
,
(
GpBitmap
**
)
ret_image
);
if
(
stat
==
Ok
)
if
(
stat
==
Ok
)
...
...
dlls/gdiplus/tests/image.c
View file @
6f630a40
...
@@ -3712,6 +3712,84 @@ static void test_GdipDrawImagePointRect(void)
...
@@ -3712,6 +3712,84 @@ static void test_GdipDrawImagePointRect(void)
expect
(
Ok
,
status
);
expect
(
Ok
,
status
);
}
}
static
void
test_image_format
(
void
)
{
static
const
PixelFormat
fmt
[]
=
{
PixelFormat1bppIndexed
,
PixelFormat4bppIndexed
,
PixelFormat8bppIndexed
,
PixelFormat16bppGrayScale
,
PixelFormat16bppRGB555
,
PixelFormat16bppRGB565
,
PixelFormat16bppARGB1555
,
PixelFormat24bppRGB
,
PixelFormat32bppRGB
,
PixelFormat32bppARGB
,
PixelFormat32bppPARGB
,
PixelFormat48bppRGB
,
PixelFormat64bppARGB
,
PixelFormat64bppPARGB
,
PixelFormat32bppCMYK
};
GpStatus
status
;
GpBitmap
*
bitmap
;
GpImage
*
thumb
;
HBITMAP
hbitmap
;
BITMAP
bm
;
PixelFormat
format
;
BitmapData
data
;
UINT
i
,
ret
;
for
(
i
=
0
;
i
<
sizeof
(
fmt
)
/
sizeof
(
fmt
[
0
]);
i
++
)
{
status
=
GdipCreateBitmapFromScan0
(
1
,
1
,
0
,
fmt
[
i
],
NULL
,
&
bitmap
);
ok
(
status
==
Ok
||
broken
(
status
==
InvalidParameter
)
/* before win7 */
,
"GdipCreateBitmapFromScan0 error %d
\n
"
,
status
);
if
(
status
!=
Ok
)
continue
;
status
=
GdipGetImagePixelFormat
((
GpImage
*
)
bitmap
,
&
format
);
expect
(
Ok
,
status
);
expect
(
fmt
[
i
],
format
);
status
=
GdipCreateHBITMAPFromBitmap
(
bitmap
,
&
hbitmap
,
0
);
if
(
fmt
[
i
]
==
PixelFormat16bppGrayScale
||
fmt
[
i
]
==
PixelFormat32bppCMYK
)
todo_wine
expect
(
InvalidParameter
,
status
);
else
{
expect
(
Ok
,
status
);
ret
=
GetObject
(
hbitmap
,
sizeof
(
bm
),
&
bm
);
expect
(
sizeof
(
bm
),
ret
);
expect
(
0
,
bm
.
bmType
);
expect
(
1
,
bm
.
bmWidth
);
expect
(
1
,
bm
.
bmHeight
);
expect
(
4
,
bm
.
bmWidthBytes
);
expect
(
1
,
bm
.
bmPlanes
);
expect
(
32
,
bm
.
bmBitsPixel
);
DeleteObject
(
hbitmap
);
}
status
=
GdipGetImageThumbnail
((
GpImage
*
)
bitmap
,
0
,
0
,
&
thumb
,
NULL
,
NULL
);
if
(
fmt
[
i
]
==
PixelFormat16bppGrayScale
||
fmt
[
i
]
==
PixelFormat32bppCMYK
)
todo_wine
ok
(
status
==
OutOfMemory
||
broken
(
status
==
InvalidParameter
)
/* before win7 */
,
"expected OutOfMemory, got %d
\n
"
,
status
);
else
{
expect
(
Ok
,
status
);
status
=
GdipGetImagePixelFormat
(
thumb
,
&
format
);
expect
(
Ok
,
status
);
ok
(
format
==
PixelFormat32bppPARGB
||
broken
(
format
!=
PixelFormat32bppPARGB
)
/* before win7 */
,
"expected PixelFormat32bppPARGB, got %#x
\n
"
,
format
);
status
=
GdipDisposeImage
(
thumb
);
expect
(
Ok
,
status
);
}
status
=
GdipBitmapLockBits
(
bitmap
,
NULL
,
ImageLockModeRead
,
PixelFormat32bppPARGB
,
&
data
);
if
(
fmt
[
i
]
==
PixelFormat16bppGrayScale
||
fmt
[
i
]
==
PixelFormat32bppCMYK
)
todo_wine
expect
(
InvalidParameter
,
status
);
else
{
expect
(
Ok
,
status
);
status
=
GdipBitmapUnlockBits
(
bitmap
,
&
data
);
expect
(
Ok
,
status
);
}
status
=
GdipDisposeImage
((
GpImage
*
)
bitmap
);
expect
(
Ok
,
status
);
}
}
START_TEST
(
image
)
START_TEST
(
image
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -3724,6 +3802,7 @@ START_TEST(image)
...
@@ -3724,6 +3802,7 @@ START_TEST(image)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_image_format
();
test_DrawImage
();
test_DrawImage
();
test_GdipDrawImagePointRect
();
test_GdipDrawImagePointRect
();
test_bitmapbits
();
test_bitmapbits
();
...
...
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