Commit 5db89dc5 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Remove fax-related tiff options

In fax mode tiff can store only 1 bit per channel images,
which Krita doesn't support. So just remove these options
from the GUI

BUG:398548
parent 75c39f3f
......@@ -56,7 +56,6 @@ void KisTIFFOptionsWidget::setConfiguration(const KisPropertiesConfigurationSP c
flattenToggled(flatten->isChecked());
qualityLevel->setValue(cfg->getInt("quality", 80));
compressionLevelDeflate->setValue(cfg->getInt("deflate", 6));
kComboBoxFaxMode->setCurrentIndex(cfg->getInt("faxmode", 0));
compressionLevelPixarLog->setValue(cfg->getInt("pixarlog", 6));
chkSaveProfile->setChecked(cfg->getBool("saveProfile", true));
......@@ -83,7 +82,6 @@ KisPropertiesConfigurationSP KisTIFFOptionsWidget::configuration() const
cfg->setProperty("flatten", flatten->isChecked());
cfg->setProperty("quality", qualityLevel->value());
cfg->setProperty("deflate", compressionLevelDeflate->value());
cfg->setProperty("faxmode", kComboBoxFaxMode->currentIndex());
cfg->setProperty("pixarlog", compressionLevelPixarLog->value());
cfg->setProperty("saveProfile", chkSaveProfile->isChecked());
......@@ -99,10 +97,7 @@ void KisTIFFOptionsWidget::activated(int index)
case 2:
codecsOptionsStack->setCurrentIndex(2);
break;
case 6:
codecsOptionsStack->setCurrentIndex(3);
break;
case 8:
case 4:
codecsOptionsStack->setCurrentIndex(4);
break;
default:
......
......@@ -172,10 +172,6 @@ KisPropertiesConfigurationSP KisTIFFOptions::toProperties() const
compToIndex[COMPRESSION_JPEG] = 1;
compToIndex[COMPRESSION_DEFLATE] = 2;
compToIndex[COMPRESSION_LZW] = 3;
compToIndex[COMPRESSION_JP2000] = 4;
compToIndex[COMPRESSION_CCITTRLE] = 5;
compToIndex[COMPRESSION_CCITTFAX3] = 6;
compToIndex[COMPRESSION_CCITTFAX4] = 7;
compToIndex[COMPRESSION_PIXARLOG] = 8;
KisPropertiesConfigurationSP cfg = new KisPropertiesConfiguration();
......@@ -186,7 +182,6 @@ KisPropertiesConfigurationSP KisTIFFOptions::toProperties() const
cfg->setProperty("flatten", flatten);
cfg->setProperty("quality", jpegQuality);
cfg->setProperty("deflate", deflateCompress);
cfg->setProperty("faxmode", faxMode - 1);
cfg->setProperty("pixarlog", pixarLogCompress);
cfg->setProperty("saveProfile", saveProfile);
......@@ -200,10 +195,9 @@ void KisTIFFOptions::fromProperties(KisPropertiesConfigurationSP cfg)
indexToComp[1] = COMPRESSION_JPEG;
indexToComp[2] = COMPRESSION_DEFLATE;
indexToComp[3] = COMPRESSION_LZW;
indexToComp[4] = COMPRESSION_JP2000;
indexToComp[5] = COMPRESSION_CCITTRLE;
indexToComp[6] = COMPRESSION_CCITTFAX3;
indexToComp[7] = COMPRESSION_CCITTFAX4;
indexToComp[4] = COMPRESSION_PIXARLOG;
// old value that might be still stored in a config (remove after Krita 5.0 :) )
indexToComp[8] = COMPRESSION_PIXARLOG;
compressionType =
......@@ -216,7 +210,6 @@ void KisTIFFOptions::fromProperties(KisPropertiesConfigurationSP cfg)
flatten = cfg->getBool("flatten", true);
jpegQuality = cfg->getInt("quality", 80);
deflateCompress = cfg->getInt("deflate", 6);
faxMode = cfg->getInt("faxmode", 0) + 1;
pixarLogCompress = cfg->getInt("pixarlog", 6);
saveProfile = cfg->getBool("saveProfile", true);
}
......@@ -731,6 +724,7 @@ KisImageBuilder_Result KisTIFFConverter::buildFile(const QString &filename, KisI
TIFFClose(image);
return KisImageBuilder_RESULT_FAILURE;
}
KisTIFFWriterVisitor* visitor = new KisTIFFWriterVisitor(image, &options);
if (!visitor->visit(root)) {
TIFFClose(image);
......
......@@ -38,7 +38,6 @@ struct KisTIFFOptions {
bool flatten = true;
quint16 jpegQuality = 80;
quint16 deflateCompress = 6;
quint16 faxMode = 1;
quint16 pixarLogCompress = 6;
bool saveProfile = true;
......
......@@ -160,7 +160,6 @@ bool KisTIFFWriterVisitor::saveLayerProjection(KisLayer *layer)
// Set the compression options
TIFFSetField(image(), TIFFTAG_COMPRESSION, m_options->compressionType);
TIFFSetField(image(), TIFFTAG_FAXMODE, m_options->faxMode);
TIFFSetField(image(), TIFFTAG_JPEGQUALITY, m_options->jpegQuality);
TIFFSetField(image(), TIFFTAG_ZIPQUALITY, m_options->deflateCompress);
TIFFSetField(image(), TIFFTAG_PIXARLOGQUALITY, m_options->pixarLogCompress);
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>411</width>
<height>276</height>
<height>299</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -20,7 +20,16 @@
<string>TIFF Options</string>
</property>
<layout class="QVBoxLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -72,26 +81,6 @@
<string>Lempel-Ziv &amp; Welch (LZW)</string>
</property>
</item>
<item>
<property name="text">
<string>Leadtools JPEG2000</string>
</property>
</item>
<item>
<property name="text">
<string>CCITT Modified Huffman RLE</string>
</property>
</item>
<item>
<property name="text">
<string>CCITT Group 3 Fax Encoding</string>
</property>
</item>
<item>
<property name="text">
<string>CCITT Group 4 Fax Encoding</string>
</property>
</item>
<item>
<property name="text">
<string>Pixar Log</string>
......@@ -197,12 +186,24 @@ You can uncheck the box if you are not using transparency and you want to make t
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="widget1">
<layout class="QHBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -222,7 +223,16 @@ You can uncheck the box if you are not using transparency and you want to make t
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -322,7 +332,16 @@ You can uncheck the box if you are not using transparency and you want to make t
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -430,66 +449,21 @@ You can uncheck the box if you are not using transparency and you want to make t
</item>
</layout>
</widget>
<widget class="QWidget" name="widget4">
<widget class="QWidget" name="widget5">
<layout class="QHBoxLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBoxCCITGroupCCITG3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>CCITT Group 3 fax encoding Options</string>
</property>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel2">
<property name="text">
<string>Fax mode:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="KComboBox" name="kComboBoxFaxMode">
<item>
<property name="text">
<string>Classic</string>
</property>
</item>
<item>
<property name="text">
<string>No RTC</string>
</property>
</item>
<item>
<property name="text">
<string>No EOL</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="widget5">
<layout class="QHBoxLayout">
<property name="spacing">
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="margin">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
......@@ -631,7 +605,6 @@ You can uncheck the box if you are not using transparency and you want to make t
<tabstop>flatten</tabstop>
<tabstop>qualityLevel</tabstop>
<tabstop>compressionLevelDeflate</tabstop>
<tabstop>kComboBoxFaxMode</tabstop>
<tabstop>compressionLevelPixarLog</tabstop>
</tabstops>
<resources/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment