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
3c74e465
Commit
3c74e465
authored
Apr 01, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add support for reading png gAMA chunks.
parent
131a7b03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
image.c
dlls/gdiplus/image.c
+46
-0
No files found.
dlls/gdiplus/image.c
View file @
3c74e465
...
...
@@ -3436,6 +3436,29 @@ static PropertyItem* create_prop(PROPID propid, PROPVARIANT* value)
return
item
;
}
static
ULONG
get_ulong_by_index
(
IWICMetadataReader
*
reader
,
ULONG
index
)
{
PROPVARIANT
value
;
HRESULT
hr
;
ULONG
result
=
0
;
hr
=
IWICMetadataReader_GetValueByIndex
(
reader
,
index
,
NULL
,
NULL
,
&
value
);
if
(
SUCCEEDED
(
hr
))
{
switch
(
value
.
vt
)
{
case
VT_UI4
:
result
=
value
.
u
.
ulVal
;
break
;
default:
ERR
(
"unhandled case %u
\n
"
,
value
.
vt
);
break
;
}
PropVariantClear
(
&
value
);
}
return
result
;
}
static
void
png_metadata_reader
(
GpBitmap
*
bitmap
,
IWICBitmapDecoder
*
decoder
,
UINT
active_frame
)
{
HRESULT
hr
;
...
...
@@ -3456,6 +3479,7 @@ static void png_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
{
"Source"
,
PropertyTagEquipModel
},
{
"Comment"
,
PropertyTagExifUserComment
},
};
BOOL
seen_gamma
=
FALSE
;
hr
=
IWICBitmapDecoder_GetFrame
(
decoder
,
active_frame
,
&
frame
);
if
(
hr
!=
S_OK
)
return
;
...
...
@@ -3502,6 +3526,28 @@ static void png_metadata_reader(GpBitmap *bitmap, IWICBitmapDecoder *decoder, UI
PropVariantClear
(
&
value
);
}
}
else
if
(
SUCCEEDED
(
hr
)
&&
IsEqualGUID
(
&
GUID_MetadataFormatChunkgAMA
,
&
format
))
{
PropertyItem
*
item
;
if
(
!
seen_gamma
)
{
item
=
GdipAlloc
(
sizeof
(
PropertyItem
)
+
sizeof
(
ULONG
)
*
2
);
if
(
item
)
{
ULONG
*
rational
;
item
->
length
=
sizeof
(
ULONG
)
*
2
;
item
->
type
=
PropertyTagTypeRational
;
item
->
id
=
PropertyTagGamma
;
rational
=
item
->
value
=
item
+
1
;
rational
[
0
]
=
100000
;
rational
[
1
]
=
get_ulong_by_index
(
reader
,
0
);
add_property
(
bitmap
,
item
);
seen_gamma
=
TRUE
;
GdipFree
(
item
);
}
}
}
IWICMetadataReader_Release
(
reader
);
}
...
...
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