13#include <QApplication>
14#include <QScopedPointer>
16#include <kpluginfactory.h>
64 bool sRGB = cs->
profile()->
name().contains(QLatin1String(
"srgb"), Qt::CaseInsensitive);
65 configuration->setProperty(
"is_sRGB", sRGB);
68 options.
progressive = configuration->getBool(
"progressive",
false);
69 options.
quality = configuration->getInt(
"quality", 80);
70 options.
forceSRGB = configuration->getBool(
"forceSRGB",
false);
71 options.
saveProfile = configuration->getBool(
"saveProfile",
true);
72 options.
optimize = configuration->getBool(
"optimize",
true);
73 options.
smooth = configuration->getInt(
"smoothing", 0);
74 options.
baseLineJPEG = configuration->getBool(
"baseline",
true);
75 options.
subsampling = configuration->getInt(
"subsampling", 0);
76 options.
exif = configuration->getBool(
"exif",
true);
77 options.
iptc = configuration->getBool(
"iptc",
true);
78 options.
xmp = configuration->getBool(
"xmp",
true);
85 options.
storeAuthor = configuration->getBool(
"storeAuthor",
false);
96 QScopedPointer<KisMetaData::Store> metaDataStore;
108 QString title = document->documentInfo()->aboutInfo(
"title");
109 if (!title.isEmpty()) {
110 if (metaDataStore->containsEntry(
"title")) {
111 metaDataStore->removeEntry(
"title");
115 QString description = document->documentInfo()->aboutInfo(
"subject");
116 if (description.isEmpty()) {
117 description = document->documentInfo()->aboutInfo(
"abstract");
119 if (!description.isEmpty()) {
120 QString keywords = document->documentInfo()->aboutInfo(
"keyword");
121 if (!keywords.isEmpty()) {
122 description = description +
" keywords: " + keywords;
124 if (metaDataStore->containsEntry(
"description")) {
125 metaDataStore->removeEntry(
"description");
129 QString license = document->documentInfo()->aboutInfo(
"license");
130 if (!license.isEmpty()) {
131 if (metaDataStore->containsEntry(
"rights")) {
132 metaDataStore->removeEntry(
"rights");
136 QString date = document->documentInfo()->aboutInfo(
"date");
137 if (!date.isEmpty() && !metaDataStore->containsEntry(
"rights")) {
142 QString author = document->documentInfo()->authorInfo(
"creator");
143 if (!author.isEmpty()) {
144 if (!document->documentInfo()->authorContactInfo().isEmpty()) {
145 QString contact = document->documentInfo()->authorContactInfo().at(0);
146 if (!contact.isEmpty()) {
147 author = author+
"("+contact+
")";
150 if (metaDataStore->containsEntry(
"creator")) {
151 metaDataStore->removeEntry(
"creator");
164 cfg->setProperty(
"progressive",
false);
165 cfg->setProperty(
"quality", 80);
166 cfg->setProperty(
"forceSRGB",
false);
167 cfg->setProperty(
"saveProfile",
true);
168 cfg->setProperty(
"optimize",
true);
169 cfg->setProperty(
"smoothing", 0);
170 cfg->setProperty(
"baseline",
true);
171 cfg->setProperty(
"subsampling", 0);
172 cfg->setProperty(
"exif",
true);
173 cfg->setProperty(
"iptc",
true);
174 cfg->setProperty(
"xmp",
true);
175 cfg->setProperty(
"storeAuthor",
false);
176 cfg->setProperty(
"storeMetaData",
false);
182 v.setValue(fill_color);
184 cfg->setProperty(
"transparencyFillcolor",
v);
185 cfg->setProperty(
"filters",
"");
201 supportedColorModels << QPair<KoID, KoID>()
215 qualityLevel->setRange(0, 100, 0);
217 smoothLevel->setRange(0, 100, 0);
224 progressive->setChecked(cfg->getBool(
"progressive",
false));
225 qualityLevel->setValue(cfg->getInt(
"quality", 80));
226 optimize->setChecked(cfg->getBool(
"optimize",
true));
227 smoothLevel->setValue(cfg->getInt(
"smoothing", 0));
228 baseLineJPEG->setChecked(cfg->getBool(
"baseline",
true));
229 subsampling->setCurrentIndex(cfg->getInt(
"subsampling", 0));
230 exif->setChecked(cfg->getBool(
"exif",
true));
231 iptc->setChecked(cfg->getBool(
"iptc",
true));
232 xmp->setChecked(cfg->getBool(
"xmp",
true));
233 chkForceSRGB->setVisible(cfg->getBool(
"is_sRGB"));
234 chkForceSRGB->setChecked(cfg->getBool(
"forceSRGB",
false));
235 chkSaveProfile->setChecked(cfg->getBool(
"saveProfile",
true));
238 bnTransparencyFillColor->setDefaultColor(background);
239 bnTransparencyFillColor->setColor(cfg->getColor(
"transparencyFillcolor", background));
240 chkAuthor->setChecked(cfg->getBool(
"storeAuthor",
false));
241 chkMetaData->setChecked(cfg->getBool(
"storeMetaData",
false));
251 QVariant transparencyFillcolor;
252 transparencyFillcolor.setValue(bnTransparencyFillColor->color());
254 cfg->setProperty(
"progressive", progressive->isChecked());
255 cfg->setProperty(
"quality", (
int)qualityLevel->value());
256 cfg->setProperty(
"forceSRGB", chkForceSRGB->isChecked());
257 cfg->setProperty(
"saveProfile", chkSaveProfile->isChecked());
258 cfg->setProperty(
"optimize", optimize->isChecked());
259 cfg->setProperty(
"smoothing", (
int)smoothLevel->value());
260 cfg->setProperty(
"baseline", baseLineJPEG->isChecked());
261 cfg->setProperty(
"subsampling", subsampling->currentIndex());
262 cfg->setProperty(
"exif", exif->isChecked());
263 cfg->setProperty(
"iptc", iptc->isChecked());
264 cfg->setProperty(
"xmp", xmp->isChecked());
265 cfg->setProperty(
"transparencyFillcolor", transparencyFillcolor);
266 cfg->setProperty(
"storeAuthor", chkAuthor->isChecked());
267 cfg->setProperty(
"storeMetaData", chkMetaData->isChecked());
269 QString enabledFilters;
271 enabledFilters = enabledFilters + filter->
id() +
',';
273 cfg->setProperty(
"filters", enabledFilters);
277#include <kis_jpeg_export.moc>
VertexDescriptor get(PredecessorMap const &m, VertexDescriptor v)
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
const quint8 OPACITY_OPAQUE_U8
The KisExifInfoVisitor class looks for a layer with metadata.
KisMetaData::Store * exifInfo()
bool visit(KisNode *) override
static KisExportCheckRegistry * instance()
KisGroupLayerSP rootLayer() const
KisPaintDeviceSP projection() const
The base class for import and export filters.
void addSupportedColorModels(QList< QPair< KoID, KoID > > supportedColorModels, const QString &name, KisExportCheckBase::Level level=KisExportCheckBase::PARTIALLY)
void addCapability(KisExportCheckBase *capability)
KisImportExportErrorCode buildFile(QIODevice *io, KisPaintLayerSP layer, KisJPEGOptions options, KisMetaData::Store *metaData)
KisPropertiesConfigurationSP defaultConfiguration(const QByteArray &from="", const QByteArray &to="") const override
defaultConfiguration defines the default settings for the given import export filter
KisJPEGExport(QObject *parent, const QVariantList &)
void initializeCapabilities() override
KisImportExportErrorCode convert(KisDocument *document, QIODevice *io, KisPropertiesConfigurationSP configuration=0) override
KisConfigWidget * createConfigurationWidget(QWidget *parent, const QByteArray &from="", const QByteArray &to="") const override
createConfigurationWidget creates a widget that can be used to define the settings for a given import...
~KisJPEGExport() override
const KoColorSpace * colorSpace() const
KisPropertiesConfigurationSP configuration() const override
KisMetaData::FilterRegistryModel m_filterRegistryModel
void setConfiguration(const KisPropertiesConfigurationSP cfg) override
KisWdgOptionsJPEG(QWidget *parent)
virtual const KoColorProfile * profile() const =0
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
K_PLUGIN_FACTORY_WITH_JSON(KritaASCCDLFactory, "kritaasccdl.json", registerPlugin< KritaASCCDL >();) KritaASCCDL
void setText(QSpinBox *spinBox, const QStringView textTemplate)
QList< const KisMetaData::Filter * > filters
QColor transparencyFillColor
bool storeDocumentMetaData
static KoColorSpaceRegistry * instance()