Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gThumb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
91
Issues
91
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
gThumb
Commits
0eaed698
Commit
0eaed698
authored
Jun 27, 2017
by
Paolo Bacchilega
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jpeg reader: use the sRGB profile if the ColorSpace tag is set to sRGB
parent
d06b6d8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
5 deletions
+42
-5
extensions/cairo_io/cairo-image-surface-jpeg.c
extensions/cairo_io/cairo-image-surface-jpeg.c
+16
-5
gthumb/gth-icc-profile.c
gthumb/gth-icc-profile.c
+25
-0
gthumb/gth-icc-profile.h
gthumb/gth-icc-profile.h
+1
-0
No files found.
extensions/cairo_io/cairo-image-surface-jpeg.c
View file @
0eaed698
...
...
@@ -200,7 +200,7 @@ _cairo_image_surface_create_from_jpeg (GInputStream *istream,
_jpeg_info_data_init
(
&
jpeg_info
);
info_flags
=
_JPEG_INFO_EXIF_ORIENTATION
;
#if HAVE_LCMS2
info_flags
|=
_JPEG_INFO_ICC_PROFILE
;
info_flags
|=
_JPEG_INFO_
EXIF_COLOR_SPACE
|
_JPEG_INFO_
ICC_PROFILE
;
#endif
_jpeg_info_get_from_buffer
(
in_buffer
,
in_buffer_size
,
info_flags
,
&
jpeg_info
);
if
(
jpeg_info
.
valid
&
_JPEG_INFO_EXIF_ORIENTATION
)
...
...
@@ -208,10 +208,21 @@ _cairo_image_surface_create_from_jpeg (GInputStream *istream,
else
orientation
=
GTH_TRANSFORM_NONE
;
#if HAVE_LCMS2
if
(
jpeg_info
.
valid
&
_JPEG_INFO_ICC_PROFILE
)
{
GthICCProfile
*
profile
=
gth_icc_profile_new
(
GTH_ICC_PROFILE_ID_UNKNOWN
,
cmsOpenProfileFromMem
(
jpeg_info
.
icc_data
,
jpeg_info
.
icc_data_size
));
gth_image_set_icc_profile
(
image
,
profile
);
g_object_unref
(
profile
);
{
GthICCProfile
*
profile
=
NULL
;
if
(
jpeg_info
.
valid
&
_JPEG_INFO_ICC_PROFILE
)
{
profile
=
gth_icc_profile_new
(
GTH_ICC_PROFILE_ID_UNKNOWN
,
cmsOpenProfileFromMem
(
jpeg_info
.
icc_data
,
jpeg_info
.
icc_data_size
));
}
else
if
(
jpeg_info
.
valid
&
_JPEG_INFO_EXIF_COLOR_SPACE
)
{
if
(
jpeg_info
.
color_space
==
GTH_COLOR_SPACE_SRGB
)
profile
=
gth_icc_profile_new_srgb
();
}
if
(
profile
!=
NULL
)
{
gth_image_set_icc_profile
(
image
,
profile
);
g_object_unref
(
profile
);
}
}
#endif
_jpeg_info_data_dispose
(
&
jpeg_info
);
...
...
gthumb/gth-icc-profile.c
View file @
0eaed698
...
...
@@ -169,6 +169,31 @@ gth_icc_profile_new (const char *id,
}
GthICCProfile
*
gth_icc_profile_new_srgb
(
void
)
{
#ifdef HAVE_LCMS2
char
*
id
;
GthCMSProfile
cmd_profile
;
GthICCProfile
*
icc_profile
;
id
=
g_strdup
(
"standard://srgb"
);
cmd_profile
=
(
GthCMSProfile
)
cmsCreate_sRGBProfile
();
icc_profile
=
gth_icc_profile_new
(
id
,
cmd_profile
);
g_free
(
id
);
return
icc_profile
;
#else
return
NULL
;
#endif
}
const
char
*
gth_icc_profile_get_id
(
GthICCProfile
*
self
)
{
...
...
gthumb/gth-icc-profile.h
View file @
0eaed698
...
...
@@ -79,6 +79,7 @@ void gth_cms_transform_free (GthCMSTransform transform);
GType
gth_icc_profile_get_type
(
void
);
GthICCProfile
*
gth_icc_profile_new
(
const
char
*
id
,
GthCMSProfile
profile
);
GthICCProfile
*
gth_icc_profile_new_srgb
(
void
);
const
char
*
gth_icc_profile_get_id
(
GthICCProfile
*
icc_profile
);
gboolean
gth_icc_profile_id_is_unknown
(
const
char
*
id
);
GthCMSProfile
gth_icc_profile_get_profile
(
GthICCProfile
*
icc_profile
);
...
...
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