Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tusooa Zhu
Krita
Commits
c8f69a1c
Commit
c8f69a1c
authored
Dec 07, 2016
by
Halla Rempt
Browse files
BUG:373267 Always save the merged image as 8 bit sRGB, no profile
Forward port of
817e66fd
parent
9ce74257
Changes
5
Hide whitespace changes
Inline
Side-by-side
libs/ui/kis_png_converter.cpp
View file @
c8f69a1c
...
...
@@ -853,6 +853,14 @@ bool KisPNGConverter::saveDeviceToStore(const QString &filename, const QRect &im
options
.
interlace
=
false
;
options
.
tryToSaveAsIndexed
=
false
;
options
.
alpha
=
true
;
options
.
saveSRGBProfile
=
false
;
if
(
dev
->
colorSpace
()
->
id
()
!=
"RGBA"
)
{
dev
=
new
KisPaintDevice
(
*
dev
.
data
());
KUndo2Command
*
cmd
=
dev
->
convertTo
(
KoColorSpaceRegistry
::
instance
()
->
rgb8
());
delete
cmd
;
}
bool
success
=
pngconv
.
buildFile
(
&
io
,
imageRect
,
xRes
,
yRes
,
dev
,
annotIt
,
annotIt
,
options
,
metaDataStore
);
if
(
success
!=
KisImageBuilder_RESULT_OK
)
{
dbgFile
<<
"Saving PNG failed:"
<<
filename
;
...
...
libs/ui/kis_png_converter.h
View file @
c8f69a1c
...
...
@@ -114,6 +114,10 @@ public:
*/
KisImageSP
image
();
/**
* @brief saveDeviceToStore saves the given paint device to the KoStore. If the device is not 8 bits sRGB, it will be converted to 8 bits sRGB.
* @return true if the saving succeeds
*/
static
bool
saveDeviceToStore
(
const
QString
&
filename
,
const
QRect
&
imageRect
,
const
qreal
xRes
,
const
qreal
yRes
,
KisPaintDeviceSP
dev
,
KoStore
*
store
,
KisMetaData
::
Store
*
metaData
=
0
);
static
bool
isColorSpaceSupported
(
const
KoColorSpace
*
cs
);
...
...
plugins/impex/libkra/kis_kra_saver.cpp
View file @
c8f69a1c
...
...
@@ -275,12 +275,6 @@ bool KisKraSaver::saveBinaryData(KoStore* store, KisImageSP image, const QString
if
(
!
autosave
)
{
KisPaintDeviceSP
dev
=
image
->
projection
();
if
(
!
KisPNGConverter
::
isColorSpaceSupported
(
dev
->
colorSpace
()))
{
dev
=
new
KisPaintDevice
(
*
dev
.
data
());
KUndo2Command
*
cmd
=
dev
->
convertTo
(
KoColorSpaceRegistry
::
instance
()
->
rgb8
());
delete
cmd
;
}
KisPNGConverter
::
saveDeviceToStore
(
"mergedimage.png"
,
image
->
bounds
(),
image
->
xRes
(),
image
->
yRes
(),
dev
,
store
);
}
...
...
plugins/impex/ora/ora_converter.cc
View file @
c8f69a1c
...
...
@@ -101,11 +101,6 @@ KisImageBuilder_Result OraConverter::buildFile(QIODevice *io, KisImageSP image,
}
KisPaintDeviceSP
dev
=
image
->
projection
();
if
(
!
KisPNGConverter
::
isColorSpaceSupported
(
dev
->
colorSpace
()))
{
dev
=
new
KisPaintDevice
(
*
dev
.
data
());
KUndo2Command
*
cmd
=
dev
->
convertTo
(
KoColorSpaceRegistry
::
instance
()
->
rgb8
());
delete
cmd
;
}
KisPNGConverter
::
saveDeviceToStore
(
"mergedimage.png"
,
image
->
bounds
(),
image
->
xRes
(),
image
->
yRes
(),
dev
,
store
);
delete
store
;
...
...
plugins/impex/ora/ora_save_context.cc
View file @
c8f69a1c
...
...
@@ -39,13 +39,6 @@ OraSaveContext::OraSaveContext(KoStore* _store) : m_id(0), m_store(_store)
QString
OraSaveContext
::
saveDeviceData
(
KisPaintDeviceSP
dev
,
KisMetaData
::
Store
*
metaData
,
const
QRect
&
imageRect
,
const
qreal
xRes
,
const
qreal
yRes
)
{
QString
filename
=
QString
(
"data/layer%1.png"
).
arg
(
m_id
++
);
if
(
!
KisPNGConverter
::
isColorSpaceSupported
(
dev
->
colorSpace
()))
{
dev
=
new
KisPaintDevice
(
*
dev
.
data
());
KUndo2Command
*
cmd
=
dev
->
convertTo
(
KoColorSpaceRegistry
::
instance
()
->
rgb8
());
delete
cmd
;
}
if
(
KisPNGConverter
::
saveDeviceToStore
(
filename
,
imageRect
,
xRes
,
yRes
,
dev
,
m_store
,
metaData
))
{
return
filename
;
}
...
...
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