summaryrefslogtreecommitdiffstats
path: root/redhat/applications/koffice/koffice-3.5.13-chalk_gmagick.patch
diff options
context:
space:
mode:
Diffstat (limited to 'redhat/applications/koffice/koffice-3.5.13-chalk_gmagick.patch')
-rw-r--r--redhat/applications/koffice/koffice-3.5.13-chalk_gmagick.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/redhat/applications/koffice/koffice-3.5.13-chalk_gmagick.patch b/redhat/applications/koffice/koffice-3.5.13-chalk_gmagick.patch
new file mode 100644
index 000000000..d497a96e7
--- /dev/null
+++ b/redhat/applications/koffice/koffice-3.5.13-chalk_gmagick.patch
@@ -0,0 +1,129 @@
+diff --git a/filters/chalk/gmagick/kis_image_magick_converter.cc b/filters/chalk/gmagick/kis_image_magick_converter.cc
+index 5bce37b..eea8000 100644
+--- a/filters/chalk/gmagick/kis_image_magick_converter.cc
++++ b/filters/chalk/gmagick/kis_image_magick_converter.cc
+@@ -182,6 +182,7 @@ namespace {
+
+ image -> addAnnotation(annotation);
+ }
++#if 0
+ for(int i = 0; i < src->generic_profiles; i++)
+ {
+ TQByteArray rawdata;
+@@ -193,6 +194,7 @@ namespace {
+
+ image -> addAnnotation(annotation);
+ }
++#endif
+
+ const ImageAttribute* imgAttr = GetImageAttribute(src, NULL);
+ while(imgAttr)
+@@ -480,7 +482,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ TQ_UINT8 opacity = OPACITY_OPAQUE;
+ const ImageAttribute * attr = GetImageAttribute(image, "[layer-opacity]");
+ if (attr != 0) {
+- opacity = TQ_UINT8_MAX - Downscale(TQString(attr->value).toInt());
++ opacity = TQ_UINT8_MAX - ScaleQuantumToChar(TQString(attr->value).toInt());
+ }
+
+ KisPaintLayerSP layer = 0;
+@@ -534,17 +536,17 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ while (!hiter.isDone())
+ {
+ TQ_UINT8 *ptr= hiter.rawData();
+- *(ptr++) = Downscale(pp->red); // cyan
+- *(ptr++) = Downscale(pp->green); // magenta
+- *(ptr++) = Downscale(pp->blue); // yellow
+- *(ptr++) = Downscale(indexes[x]); // Black
++ *(ptr++) = ScaleQuantumToChar(pp->red); // cyan
++ *(ptr++) = ScaleQuantumToChar(pp->green); // magenta
++ *(ptr++) = ScaleQuantumToChar(pp->blue); // yellow
++ *(ptr++) = ScaleQuantumToChar(indexes[x]); // Black
+ // XXX: Warning! This ifdef messes up the paren matching big-time!
+ #ifdef HAVE_MAGICK6
+ if (image->matte != MagickFalse) {
+ #else
+ if (image->matte == true) {
+ #endif
+- *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
++ *(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity);
+ }
+ else {
+ *(ptr++) = OPACITY_OPAQUE;
+@@ -578,10 +580,10 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ {
+ TQ_UINT8 *ptr= hiter.rawData();
+ // XXX: not colorstrategy and bitdepth independent
+- *(ptr++) = Downscale(pp->blue);
+- *(ptr++) = Downscale(pp->green);
+- *(ptr++) = Downscale(pp->red);
+- *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
++ *(ptr++) = ScaleQuantumToChar(pp->blue);
++ *(ptr++) = ScaleQuantumToChar(pp->green);
++ *(ptr++) = ScaleQuantumToChar(pp->red);
++ *(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity);
+
+ pp++;
+ ++hiter;
+@@ -608,8 +610,8 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ {
+ TQ_UINT8 *ptr= hiter.rawData();
+ // XXX: not colorstrategy and bitdepth independent
+- *(ptr++) = Downscale(pp->blue);
+- *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
++ *(ptr++) = ScaleQuantumToChar(pp->blue);
++ *(ptr++) = OPACITY_OPAQUE - ScaleQuantumToChar(pp->opacity);
+
+ pp++;
+ ++hiter;
+@@ -812,13 +814,12 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ while (!it.isDone()) {
+
+ TQ_UINT8 * d = it.rawData();
+- pp -> red = Upscale(d[PIXEL_CYAN]);
+- pp -> green = Upscale(d[PIXEL_MAGENTA]);
+- pp -> blue = Upscale(d[PIXEL_YELLOW]);
++ pp -> red = ScaleCharToQuantum(d[PIXEL_CYAN]);
++ pp -> green = ScaleCharToQuantum(d[PIXEL_MAGENTA]);
++ pp -> blue = ScaleCharToQuantum(d[PIXEL_YELLOW]);
+ if (alpha)
+- pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]);
+-
+- indexes[x]= Upscale(d[PIXEL_BLACK]);
++ pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]);
++ indexes[x]= ScaleCharToQuantum(d[PIXEL_BLACK]);
+
+ x++;
+ pp++;
+@@ -848,11 +849,11 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ while (!it.isDone()) {
+
+ TQ_UINT8 * d = it.rawData();
+- pp -> red = Upscale(d[PIXEL_RED]);
+- pp -> green = Upscale(d[PIXEL_GREEN]);
+- pp -> blue = Upscale(d[PIXEL_BLUE]);
++ pp -> red = ScaleCharToQuantum(d[PIXEL_RED]);
++ pp -> green = ScaleCharToQuantum(d[PIXEL_GREEN]);
++ pp -> blue = ScaleCharToQuantum(d[PIXEL_BLUE]);
+ if (alpha)
+- pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_ALPHA]);
++ pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_ALPHA]);
+
+ pp++;
+ ++it;
+@@ -879,11 +880,11 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
+ else {
+ while (!it.isDone()) {
+ TQ_UINT8 * d = it.rawData();
+- pp -> red = Upscale(d[PIXEL_GRAY]);
+- pp -> green = Upscale(d[PIXEL_GRAY]);
+- pp -> blue = Upscale(d[PIXEL_GRAY]);
++ pp -> red = ScaleCharToQuantum(d[PIXEL_GRAY]);
++ pp -> green = ScaleCharToQuantum(d[PIXEL_GRAY]);
++ pp -> blue = ScaleCharToQuantum(d[PIXEL_GRAY]);
+ if (alpha)
+- pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]);
++ pp -> opacity = ScaleCharToQuantum(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]);
+
+ pp++;
+ ++it;