diff options
Diffstat (limited to 'filters/chalk')
-rw-r--r-- | filters/chalk/gmagick/kis_image_magick_converter.cpp | 24 | ||||
-rw-r--r-- | filters/chalk/magick/kis_image_magick_converter.cpp | 9 |
2 files changed, 14 insertions, 19 deletions
diff --git a/filters/chalk/gmagick/kis_image_magick_converter.cpp b/filters/chalk/gmagick/kis_image_magick_converter.cpp index 01e1ee141..5c9d8dc36 100644 --- a/filters/chalk/gmagick/kis_image_magick_converter.cpp +++ b/filters/chalk/gmagick/kis_image_magick_converter.cpp @@ -121,14 +121,14 @@ namespace { KisProfile * getProfileForProfileInfo(const Image * image) { size_t length; - + const unsigned char * profiledata = GetImageProfile(image, "ICM", &length); if( profiledata == NULL ) return 0; TQByteArray rawdata; rawdata.resize(length); memcpy(rawdata.data(), profiledata, length); - + KisProfile* p = new KisProfile(rawdata); return p; @@ -169,14 +169,14 @@ namespace { void setAnnotationsForImage(const Image * src, KisImageSP image) { size_t length; - + const unsigned char * profiledata = GetImageProfile(src, "IPTC", &length); if( profiledata != NULL ) { TQByteArray rawdata; rawdata.resize(length); memcpy(rawdata.data(), profiledata, length); - + KisAnnotation* annotation = new KisAnnotation(TQString("IPTC"), "", rawdata); TQ_CHECK_PTR(annotation); @@ -189,14 +189,14 @@ namespace { TQByteArray rawdata; rawdata.resize(length); memcpy(rawdata.data(), src->generic_profile[i].info, src->generic_profile[i].length); - + KisAnnotation* annotation = new KisAnnotation(TQString(src->generic_profile[i].name), "", rawdata); TQ_CHECK_PTR(annotation); image -> addAnnotation(annotation); } #endif - + const ImageAttribute* imgAttr = GetImageAttribute(src, NULL); while(imgAttr) { @@ -204,7 +204,7 @@ namespace { int len = strlen(imgAttr -> value) + 1; rawdata.resize(len); memcpy(rawdata.data(), imgAttr -> value, len); - + KisAnnotation* annotation = new KisAnnotation( TQString("chalk_attribute:%1").arg(TQString(imgAttr -> key)), "", rawdata ); TQ_CHECK_PTR(annotation); @@ -310,7 +310,6 @@ namespace { if (!init) { TDEApplication *app = tdeApp; - InitializeMagick(*app -> argv()); atexit(DestroyMagick); init = true; @@ -331,7 +330,6 @@ namespace { MagickBooleanType monitor(const char *text, const ExtendedSignedIntegralType, const ExtendedUnsignedIntegralType, ExceptionInfo *) { TDEApplication *app = tdeApp; - Q_ASSERT(app); if (app -> hasPendingEvents()) @@ -408,7 +406,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB kdDebug(41008) << "Exceptions happen when loading" << endl; return KisImageBuilder_RESULT_FAILURE; } - + if (images == 0) { DestroyImageInfo(ii); @@ -447,7 +445,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB } kdDebug(41008) << "image has " << csName << " colorspace\n"; - + KisProfile * profile = getProfileForProfileInfo(image); if (profile) { @@ -472,7 +470,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB m_img = new KisImage(m_doc->undoAdapter(), image -> columns, image -> rows, cs, "built image"); TQ_CHECK_PTR(m_img); m_img->blockSignals(true); // Don't send out signals while we're building the image - + // XXX I'm assuming seperate layers won't have other profile things like EXIF setAnnotationsForImage(image, m_img); } @@ -562,7 +560,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB while(! hiter.isDone()) { TQ_UINT16 *ptr = reinterpret_cast<TQ_UINT16 *>(hiter.rawData()); - + *(ptr++) = ScaleQuantumToShort(pp->red); *(ptr++) = ScaleQuantumToShort(pp->green); *(ptr++) = ScaleQuantumToShort(pp->blue); diff --git a/filters/chalk/magick/kis_image_magick_converter.cpp b/filters/chalk/magick/kis_image_magick_converter.cpp index 5ea939e44..0c79e1f5f 100644 --- a/filters/chalk/magick/kis_image_magick_converter.cpp +++ b/filters/chalk/magick/kis_image_magick_converter.cpp @@ -258,7 +258,6 @@ namespace { if (!init) { TDEApplication *app = tdeApp; - InitializeMagick(*app -> argv()); atexit(DestroyMagick); init = true; @@ -279,7 +278,6 @@ namespace { MagickBooleanType monitor(const char *text, const ExtendedSignedIntegralType, const ExtendedUnsignedIntegralType, ExceptionInfo *) { TDEApplication *app = tdeApp; - Q_ASSERT(app); if (app -> hasPendingEvents()) @@ -292,7 +290,6 @@ namespace { unsigned int monitor(const char *text, const ExtendedSignedIntegralType, const ExtendedUnsignedIntegralType, ExceptionInfo *) { TDEApplication *app = tdeApp; - Q_ASSERT(app); if (app -> hasPendingEvents()) @@ -389,7 +386,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB } kdDebug(41008) << "image has " << csName << " colorspace\n"; - + KisProfile * profile = getProfileForProfileInfo(image); if (profile) { @@ -414,7 +411,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB m_img = new KisImage(m_doc->undoAdapter(), image -> columns, image -> rows, cs, "built image"); TQ_CHECK_PTR(m_img); m_img->blockSignals(true); // Don't send out signals while we're building the image - + // XXX I'm assuming seperate layers won't have other profile things like EXIF setAnnotationsForImage(image, m_img); } @@ -504,7 +501,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB while(! hiter.isDone()) { TQ_UINT16 *ptr = reinterpret_cast<TQ_UINT16 *>(hiter.rawData()); - + *(ptr++) = ScaleQuantumToShort(pp->red); *(ptr++) = ScaleQuantumToShort(pp->green); *(ptr++) = ScaleQuantumToShort(pp->blue); |