24#include <magick/api.h>
27#include <tqfileinfo.h>
30#include <tdeapplication.h>
33#include <tdeio/netaccess.h>
38#include "kis_global.h"
42#include "kis_undo_adapter.h"
43#include "kis_image_magick_converter.h"
44#include "kis_meta_registry.h"
45#include "kis_colorspace_factory_registry.h"
46#include "kis_iterators_pixel.h"
47#include "kis_colorspace.h"
48#include "kis_profile.h"
49#include "kis_annotation.h"
50#include "kis_paint_layer.h"
51#include "kis_group_layer.h"
52#include "kis_paint_device.h"
54#include "../../../config.h"
58 const TQ_UINT8 PIXEL_BLUE = 0;
59 const TQ_UINT8 PIXEL_GREEN = 1;
60 const TQ_UINT8 PIXEL_RED = 2;
61 const TQ_UINT8 PIXEL_ALPHA = 3;
63 static const TQ_UINT8 PIXEL_CYAN = 0;
64 static const TQ_UINT8 PIXEL_MAGENTA = 1;
65 static const TQ_UINT8 PIXEL_YELLOW = 2;
66 static const TQ_UINT8 PIXEL_BLACK = 3;
67 static const TQ_UINT8 PIXEL_CMYK_ALPHA = 4;
69 static const TQ_UINT8 PIXEL_GRAY = 0;
70 static const TQ_UINT8 PIXEL_GRAY_ALPHA = 1;
76 TQString getColorSpaceName(ColorspaceType type,
unsigned long imageDepth = 8)
79 if (type == GRAYColorspace) {
82 else if ( imageDepth == 16 )
85 else if (type == CMYKColorspace) {
88 else if ( imageDepth == 16 ) {
92 else if (type == LABColorspace) {
93 kdDebug(41008) <<
"Lab!\n";
96 else if (type == RGBColorspace || type == sRGBColorspace || type == TransparentColorspace) {
99 else if (imageDepth == 16)
106 ColorspaceType getColorTypeforColorSpace( KisColorSpace * cs )
108 if ( cs->id() == KisID(
"GRAYA") || cs->id() == KisID(
"GRAYA16") )
return GRAYColorspace;
109 if ( cs->id() == KisID(
"RGBA") || cs->id() == KisID(
"RGBA16") )
return RGBColorspace;
110 if ( cs->id() == KisID(
"CMYK") || cs->id() == KisID(
"CMYK16") )
return CMYKColorspace;
111 if ( cs->id() == KisID(
"LABA") )
return LABColorspace;
113 kdDebug(41008) <<
"Cannot export images in " + cs->id().name() +
" yet.\n";
114 return RGBColorspace;
118 KisProfile * getProfileForProfileInfo(
const Image * image)
124 if (image->profiles == NULL)
128 const StringInfo *profile;
132 ResetImageProfileIterator(image);
133 for (name = GetNextImageProfile(image); name != (
char *) NULL; )
135 profile = GetImageProfile(image, name);
136 if (profile == (StringInfo *) NULL)
140 if (TQString::compare(name,
"icc") == 0) {
142 rawdata.resize(profile->length);
143 memcpy(rawdata.data(), profile->datum, profile->length);
145 p =
new KisProfile(rawdata);
149 name = GetNextImageProfile(image);
155 void setAnnotationsForImage(
const Image * src, KisImageSP image)
160 if (src->profiles == NULL)
163 const char *name = 0;
164 const StringInfo *profile;
165 KisAnnotation* annotation = 0;
168 ResetImageProfileIterator(src);
169 while((name = GetNextImageProfile(src))) {
170 profile = GetImageProfile(src, name);
171 if (profile == (StringInfo *) NULL)
175 if (TQString::compare(name,
"icc") == 0)
179 rawdata.resize(profile->length);
180 memcpy(rawdata.data(), profile->datum, profile->length);
182 annotation =
new KisAnnotation(TQString(name),
"", rawdata);
183 TQ_CHECK_PTR(annotation);
185 image -> addAnnotation(annotation);
193#if MagickLibVersion >= 0x621
194 const ImageAttribute * attr;
195 ResetImageAttributeIterator(src);
196 while ( (attr = GetNextImageAttribute(src)) ) {
198 ImageAttribute * attr = src -> attributes;
202 int len = strlen(attr -> value) + 1;
204 memcpy(rawdata.data(), attr -> value, len);
206 annotation =
new KisAnnotation(
207 TQString(
"chalk_attribute:%1").arg(TQString(attr -> key)),
"", rawdata);
208 TQ_CHECK_PTR(annotation);
210 image -> addAnnotation(annotation);
211#if MagickLibVersion < 0x620
220 void exportAnnotationsForImage(Image * dst, vKisAnnotationSP_it& it, vKisAnnotationSP_it& annotationsEnd)
225 while(it != annotationsEnd) {
226 if (!(*it) || (*it) -> type() == TQString()) {
227 kdDebug(41008) <<
"Warning: empty annotation" << endl;
232 kdDebug(41008) <<
"Trying to store annotation of type " << (*it) -> type() <<
" of size " << (*it) -> annotation() . size() << endl;
234 if ((*it) -> type().startsWith(
"chalk_attribute:")) {
235 if (!SetImageAttribute(dst,
236 (*it) -> type().mid(strlen(
"chalk_attribute:")).ascii(),
237 (*it) -> annotation() . data()) ) {
238 kdDebug(41008) <<
"Storing of attribute " << (*it) -> type() <<
"failed!\n";
241 if (!ProfileImage(dst, (*it) -> type().ascii(),
242 (
unsigned char*)(*it) -> annotation() . data(),
243 (*it) -> annotation() . size(), MagickFalse)) {
244 kdDebug(41008) <<
"Storing failed!" << endl;
253 void InitGlobalMagick()
255 static bool init =
false;
258 TDEApplication *app = TDEApplication::kApplication();
259 InitializeMagick(*app -> argv());
260 atexit(DestroyMagick);
276 MagickBooleanType monitor(
const char *text,
const ExtendedSignedIntegralType,
const ExtendedUnsignedIntegralType, ExceptionInfo *)
278 TDEApplication *app = TDEApplication::kApplication();
281 if (app -> hasPendingEvents())
282 app -> processEvents();
284 printf(
"%s\n", text);
288 unsigned int monitor(
const char *text,
const ExtendedSignedIntegralType,
const ExtendedUnsignedIntegralType, ExceptionInfo *)
290 TDEApplication *app = TDEApplication::kApplication();
293 if (app -> hasPendingEvents())
294 app -> processEvents();
296 printf(
"%s\n", text);
303KisImageMagickConverter::KisImageMagickConverter(KisDoc *doc, KisUndoAdapter *adapter)
307 SetMonitorHandler(monitor);
311KisImageMagickConverter::~KisImageMagickConverter()
315KisImageBuilder_Result KisImageMagickConverter::decode(
const KURL& uri,
bool isBlob)
324 return KisImageBuilder_RESULT_INTR;
327 GetExceptionInfo(&ei);
328 ii = CloneImageInfo(0);
333 Q_ASSERT(uri.isEmpty());
334 images = BlobToImage(ii, &m_data[0], m_data.size(), &ei);
337 tqstrncpy(ii -> filename, TQFile::encodeName(uri.path()), MaxTextExtent - 1);
339 if (ii -> filename[MaxTextExtent - 1]) {
340 emit notifyProgressError();
341 return KisImageBuilder_RESULT_PATH;
344 images = ReadImage(ii, &ei);
348 if (ei.severity != UndefinedException)
352 DestroyImageInfo(ii);
353 DestroyExceptionInfo(&ei);
354 emit notifyProgressError();
355 return KisImageBuilder_RESULT_FAILURE;
358 emit notifyProgressStage(i18n(
"Importing..."), 0);
362 while ((image = RemoveFirstImageFromList(&images))) {
363 ViewInfo *vi = OpenCacheView(image);
366 unsigned long imageDepth = image->depth;
367 kdDebug(41008) <<
"Image depth: " << imageDepth <<
"\n";
370 KisColorSpace * cs = 0;
371 ColorspaceType colorspaceType;
374 if (GetImageType(image, &ei) == GrayscaleType || GetImageType(image, &ei) == GrayscaleMatteType) {
377 else if ( imageDepth == 16 )
379 colorspaceType = GRAYColorspace;
382 colorspaceType = image->colorspace;
383 csName = getColorSpaceName(image -> colorspace, imageDepth);
386 kdDebug(41008) <<
"image has " << csName <<
" colorspace\n";
388 KisProfile * profile = getProfileForProfileInfo(image);
391 kdDebug(41008) <<
"image has embedded profile: " << profile -> productName() <<
"\n";
392 cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(csName, profile);
395 cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID(csName,
""),
"");
398 kdDebug(41008) <<
"Chalk does not support colorspace " << image -> colorspace <<
"\n";
401 DestroyExceptionInfo(&ei);
402 DestroyImageList(images);
403 DestroyImageInfo(ii);
404 emit notifyProgressError();
405 return KisImageBuilder_RESULT_UNSUPPORTED_COLORSPACE;
409 m_img =
new KisImage(m_doc->undoAdapter(), image -> columns, image -> rows, cs,
"built image");
411 m_img->blockSignals(
true);
414 setAnnotationsForImage(image, m_img);
417 if (image -> columns && image -> rows) {
420 TQ_UINT8 opacity = OPACITY_OPAQUE;
421 const ImageAttribute * attr = GetImageAttribute(image,
"[layer-opacity]");
423 opacity = TQ_UINT8_MAX - Downscale(TQString(attr->value).toInt());
426 KisPaintLayerSP layer = 0;
428 attr = GetImageAttribute(image,
"[layer-name]");
430 layer =
new KisPaintLayer(m_img, attr->value, opacity);
433 layer =
new KisPaintLayer(m_img, m_img -> nextLayerName(), opacity);
439 TQ_INT32 x_offset = 0;
440 TQ_INT32 y_offset = 0;
442 attr = GetImageAttribute(image,
"[layer-xpos]");
444 x_offset = TQString(attr->value).toInt();
447 attr = GetImageAttribute(image,
"[layer-ypos]");
449 y_offset = TQString(attr->value).toInt();
453 for (TQ_UINT32 y = 0; y < image->rows; y ++)
455 const PixelPacket *pp = AcquireCacheView(vi, 0, y, image->columns, 1, &ei);
460 DestroyImageList(images);
461 DestroyImageInfo(ii);
462 DestroyExceptionInfo(&ei);
463 emit notifyProgressError();
464 return KisImageBuilder_RESULT_FAILURE;
467 IndexPacket * indexes = GetCacheViewIndexes(vi);
469 KisHLineIteratorPixel hiter = layer->paintDevice()->createHLineIterator(0, y, image->columns,
true);
471 if (colorspaceType== CMYKColorspace) {
472 if (imageDepth == 8) {
474 while (!hiter.isDone())
476 TQ_UINT8 *ptr= hiter.rawData();
477 *(ptr++) = Downscale(pp->red);
478 *(ptr++) = Downscale(pp->green);
479 *(ptr++) = Downscale(pp->blue);
480 *(ptr++) = Downscale(indexes[x]);
483 if (image->matte != MagickFalse) {
485 if (image->matte ==
true) {
487 *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
490 *(ptr++) = OPACITY_OPAQUE;
498 else if (colorspaceType == LABColorspace) {
499 while(! hiter.isDone())
501 TQ_UINT16 *ptr =
reinterpret_cast<TQ_UINT16 *
>(hiter.rawData());
503 *(ptr++) = ScaleQuantumToShort(pp->red);
504 *(ptr++) = ScaleQuantumToShort(pp->green);
505 *(ptr++) = ScaleQuantumToShort(pp->blue);
506 *(ptr++) = 65535 - ScaleQuantumToShort(pp->opacity);
512 else if (colorspaceType == RGBColorspace ||
513 colorspaceType == sRGBColorspace ||
514 colorspaceType == TransparentColorspace)
516 if (imageDepth == 8) {
517 while(! hiter.isDone())
519 TQ_UINT8 *ptr= hiter.rawData();
521 *(ptr++) = Downscale(pp->blue);
522 *(ptr++) = Downscale(pp->green);
523 *(ptr++) = Downscale(pp->red);
524 *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
530 else if (imageDepth == 16) {
531 while(! hiter.isDone())
533 TQ_UINT16 *ptr =
reinterpret_cast<TQ_UINT16 *
>(hiter.rawData());
535 *(ptr++) = ScaleQuantumToShort(pp->blue);
536 *(ptr++) = ScaleQuantumToShort(pp->green);
537 *(ptr++) = ScaleQuantumToShort(pp->red);
538 *(ptr++) = 65535 - ScaleQuantumToShort(pp->opacity);
545 else if ( colorspaceType == GRAYColorspace) {
546 if (imageDepth == 8) {
547 while(! hiter.isDone())
549 TQ_UINT8 *ptr= hiter.rawData();
551 *(ptr++) = Downscale(pp->blue);
552 *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
558 else if (imageDepth == 16) {
559 while(! hiter.isDone())
561 TQ_UINT16 *ptr =
reinterpret_cast<TQ_UINT16 *
>(hiter.rawData());
563 *(ptr++) = ScaleQuantumToShort(pp->blue);
564 *(ptr++) = 65535 - ScaleQuantumToShort(pp->opacity);
572 emit notifyProgress(y * 100 / image->rows);
577 DestroyImageList(images);
578 DestroyImageInfo(ii);
579 DestroyExceptionInfo(&ei);
581 return KisImageBuilder_RESULT_INTR;
584 m_img->addLayer(layer.data(), m_img->rootLayer());
585 layer->paintDevice()->move(x_offset, y_offset);
588 emit notifyProgressDone();
593 emit notifyProgressDone();
594 DestroyImageList(images);
595 DestroyImageInfo(ii);
596 DestroyExceptionInfo(&ei);
597 return KisImageBuilder_RESULT_OK;
600 KisImageBuilder_Result KisImageMagickConverter::buildImage(
const KURL& uri)
603 return KisImageBuilder_RESULT_NO_URI;
605 if (!TDEIO::NetAccess::exists(uri,
false, tqApp -> mainWidget())) {
606 return KisImageBuilder_RESULT_NOT_EXIST;
609 KisImageBuilder_Result result = KisImageBuilder_RESULT_FAILURE;
612 if (TDEIO::NetAccess::download(uri, tmpFile, tqApp -> mainWidget())) {
614 uriTF.setPath( tmpFile );
615 result = decode(uriTF,
false);
616 TDEIO::NetAccess::removeTempFile(tmpFile);
623 KisImageSP KisImageMagickConverter::image()
628 void KisImageMagickConverter::init(KisDoc *doc, KisUndoAdapter *adapter)
635 KisImageBuilder_Result KisImageMagickConverter::buildFile(
const KURL& uri, KisPaintLayerSP layer, vKisAnnotationSP_it annotationsStart, vKisAnnotationSP_it annotationsEnd)
642 return KisImageBuilder_RESULT_INVALID_ARG;
644 KisImageSP img = layer->image();
646 return KisImageBuilder_RESULT_EMPTY;
649 return KisImageBuilder_RESULT_NO_URI;
651 if (!uri.isLocalFile())
652 return KisImageBuilder_RESULT_NOT_LOCAL;
655 TQ_UINT32 layerBytesPerChannel = layer->paintDevice()->pixelSize() / layer->paintDevice()->nChannels();
657 GetExceptionInfo(&ei);
659 ii = CloneImageInfo(0);
661 tqstrncpy(ii -> filename, TQFile::encodeName(uri.path()), MaxTextExtent - 1);
663 if (ii -> filename[MaxTextExtent - 1]) {
664 emit notifyProgressError();
665 return KisImageBuilder_RESULT_PATH;
668 if (!img -> width() || !img -> height())
669 return KisImageBuilder_RESULT_EMPTY;
671 if (layerBytesPerChannel < 2) {
678 ii->colorspace = getColorTypeforColorSpace(layer->paintDevice()->colorSpace());
680 image = AllocateImage(ii);
681 SetImageColorspace(image, ii->colorspace);
682 image -> columns = img -> width();
683 image -> rows = img -> height();
685 kdDebug(41008) <<
"Saving with colorspace " << image->colorspace <<
", (" << layer->paintDevice()->colorSpace()->id().name() <<
")\n";
686 kdDebug(41008) <<
"IM Image thinks it has depth: " << image->depth <<
"\n";
690 image -> matte = MagickTrue;
695 image -> matte =
true;
698 TQ_INT32 y, height, width;
700 height = img -> height();
701 width = img -> width();
704 TQString ext = TQFileInfo(TQFile::encodeName(uri.path())).extension(
false).upper();
707 tqstrncpy(ii->magick,
"BMP2", MaxTextExtent - 1);
709 else if (ext ==
"RGB") {
710 tqstrncpy(ii->magick,
"SGI", MaxTextExtent - 1);
713 for (y = 0; y < height; y++) {
716 PixelPacket * pp = SetImagePixels(image, 0, y, width, 1);
719 DestroyExceptionInfo(&ei);
721 emit notifyProgressError();
722 return KisImageBuilder_RESULT_FAILURE;
726 KisHLineIterator it = layer->paintDevice()->createHLineIterator(0, y, width,
false);
728 SetImageType(image, TrueColorMatteType);
730 SetImageType(image, TrueColorType);
732 if (image->colorspace== CMYKColorspace) {
734 IndexPacket * indexes = GetIndexes(image);
736 if (layerBytesPerChannel == 2) {
737 while (!it.isDone()) {
739 const TQ_UINT16 *d =
reinterpret_cast<const TQ_UINT16 *
>(it.rawData());
740 pp -> red = ScaleShortToQuantum(d[PIXEL_CYAN]);
741 pp -> green = ScaleShortToQuantum(d[PIXEL_MAGENTA]);
742 pp -> blue = ScaleShortToQuantum(d[PIXEL_YELLOW]);
744 pp -> opacity = ScaleShortToQuantum(65535 - d[PIXEL_CMYK_ALPHA]);
745 indexes[x] = ScaleShortToQuantum(d[PIXEL_BLACK]);
752 while (!it.isDone()) {
754 TQ_UINT8 * d = it.rawData();
755 pp -> red = Upscale(d[PIXEL_CYAN]);
756 pp -> green = Upscale(d[PIXEL_MAGENTA]);
757 pp -> blue = Upscale(d[PIXEL_YELLOW]);
759 pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]);
761 indexes[x]= Upscale(d[PIXEL_BLACK]);
769 else if (image->colorspace== RGBColorspace ||
770 image->colorspace == sRGBColorspace ||
771 image->colorspace == TransparentColorspace)
773 if (layerBytesPerChannel == 2) {
774 while (!it.isDone()) {
776 const TQ_UINT16 *d =
reinterpret_cast<const TQ_UINT16 *
>(it.rawData());
777 pp -> red = ScaleShortToQuantum(d[PIXEL_RED]);
778 pp -> green = ScaleShortToQuantum(d[PIXEL_GREEN]);
779 pp -> blue = ScaleShortToQuantum(d[PIXEL_BLUE]);
781 pp -> opacity = ScaleShortToQuantum(65535 - d[PIXEL_ALPHA]);
788 while (!it.isDone()) {
790 TQ_UINT8 * d = it.rawData();
791 pp -> red = Upscale(d[PIXEL_RED]);
792 pp -> green = Upscale(d[PIXEL_GREEN]);
793 pp -> blue = Upscale(d[PIXEL_BLUE]);
795 pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_ALPHA]);
802 else if (image->colorspace == GRAYColorspace)
804 SetImageType(image, GrayscaleMatteType);
805 if (layerBytesPerChannel == 2) {
806 while (!it.isDone()) {
808 const TQ_UINT16 *d =
reinterpret_cast<const TQ_UINT16 *
>(it.rawData());
809 pp -> red = ScaleShortToQuantum(d[PIXEL_GRAY]);
810 pp -> green = ScaleShortToQuantum(d[PIXEL_GRAY]);
811 pp -> blue = ScaleShortToQuantum(d[PIXEL_GRAY]);
813 pp -> opacity = ScaleShortToQuantum(65535 - d[PIXEL_GRAY_ALPHA]);
820 while (!it.isDone()) {
821 TQ_UINT8 * d = it.rawData();
822 pp -> red = Upscale(d[PIXEL_GRAY]);
823 pp -> green = Upscale(d[PIXEL_GRAY]);
824 pp -> blue = Upscale(d[PIXEL_GRAY]);
826 pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]);
834 kdDebug(41008) <<
"Unsupported image format\n";
835 return KisImageBuilder_RESULT_INVALID_ARG;
838 emit notifyProgressStage(i18n(
"Saving..."), y * 100 / height);
841 if (SyncImagePixels(image) == MagickFalse)
842 kdDebug(41008) <<
"Syncing pixels failed\n";
844 if (!SyncImagePixels(image))
845 kdDebug(41008) <<
"Syncing pixels failed\n";
850 exportAnnotationsForImage(image, annotationsStart, annotationsEnd);
855 WriteImage(ii, image);
856 DestroyExceptionInfo(&ei);
858 emit notifyProgressDone();
859 return KisImageBuilder_RESULT_OK;
862 void KisImageMagickConverter::ioData(TDEIO::Job *job,
const TQByteArray& data)
864 if (data.isNull() || data.isEmpty()) {
865 emit notifyProgressStage(i18n(
"Loading..."), 0);
869 if (m_data.empty()) {
874 ii = CloneImageInfo(0);
875 GetExceptionInfo(&ei);
876 image = PingBlob(ii, data.data(), data.size(), &ei);
878 if (image == 0 || ei.severity == BlobError) {
879 DestroyExceptionInfo(&ei);
880 DestroyImageInfo(ii);
882 emit notifyProgressError();
887 DestroyExceptionInfo(&ei);
888 DestroyImageInfo(ii);
889 emit notifyProgressStage(i18n(
"Loading..."), 0);
892 Q_ASSERT(data.size() + m_data.size() <= m_size);
893 memcpy(&m_data[m_data.size()], data.data(), data.count());
894 m_data.resize(m_data.size() + data.count());
895 emit notifyProgressStage(i18n(
"Loading..."), m_data.size() * 100 / m_size);
901 void KisImageMagickConverter::ioResult(TDEIO::Job *job)
906 emit notifyProgressError();
908 decode(KURL(),
true);
911 void KisImageMagickConverter::ioTotalSize(TDEIO::Job * , TDEIO::filesize_t size)
914 m_data.reserve(size);
915 emit notifyProgressStage(i18n(
"Loading..."), 0);
918 void KisImageMagickConverter::cancel()
927 TQString KisImageMagickConverter::readFilters()
932 TQString description;
933 unsigned long matches;
936#ifdef HAVE_OLD_GETMAGICKINFOLIST
937 const MagickInfo **mi;
938 mi = GetMagickInfoList(
"*", &matches);
941 GetExceptionInfo(&ei);
942 const MagickInfo **mi;
943 mi = GetMagickInfoList(
"*", &matches, &ei);
944 DestroyExceptionInfo(&ei);
947 const MagickInfo *mi;
949 GetExceptionInfo(&ei);
950 mi = GetMagickInfo(
"*", &ei);
951 DestroyExceptionInfo(&ei);
958 for (
unsigned long i = 0; i < matches; i++) {
959 const MagickInfo *info = mi[i];
963 if (info -> decoder) {
965 description = info -> description;
966 kdDebug(41008) <<
"Found import filter for: " << name <<
"\n";
968 if (!description.isEmpty() && !description.contains(
'/')) {
969 all +=
"*." + name.lower() +
" *." + name +
" ";
970 s +=
"*." + name.lower() +
" *." + name +
"|";
971 s += i18n(description.utf8());
977 for (; mi; mi =
reinterpret_cast<const MagickInfo*
>(mi -> next)) {
982 description = mi -> description;
983 kdDebug(41008) <<
"Found import filter for: " << name <<
"\n";
985 if (!description.isEmpty() && !description.contains(
'/')) {
986 all +=
"*." + name.lower() +
" *." + name +
" ";
987 s +=
"*." + name.lower() +
" *." + name +
"|";
988 s += i18n(description.utf8());
995 all +=
"|" + i18n(
"All Images");
1001 TQString KisImageMagickConverter::writeFilters()
1006 TQString description;
1007 unsigned long matches;
1010#ifdef HAVE_OLD_GETMAGICKINFOLIST
1011 const MagickInfo **mi;
1012 mi = GetMagickInfoList(
"*", &matches);
1015 GetExceptionInfo(&ei);
1016 const MagickInfo **mi;
1017 mi = GetMagickInfoList(
"*", &matches, &ei);
1018 DestroyExceptionInfo(&ei);
1021 const MagickInfo *mi;
1023 GetExceptionInfo(&ei);
1024 mi = GetMagickInfo(
"*", &ei);
1025 DestroyExceptionInfo(&ei);
1029 kdDebug(41008) <<
"Eek, no magick info!\n";
1034 for (
unsigned long i = 0; i < matches; i++) {
1035 const MagickInfo *info = mi[i];
1036 kdDebug(41008) <<
"Found export filter for: " << info -> name <<
"\n";
1037 if (info -> stealth)
1040 if (info -> encoder) {
1041 name = info -> name;
1043 description = info -> description;
1045 if (!description.isEmpty() && !description.contains(
'/')) {
1046 all +=
"*." + name.lower() +
" *." + name +
" ";
1047 s +=
"*." + name.lower() +
" *." + name +
"|";
1048 s += i18n(description.utf8());
1054 for (; mi; mi =
reinterpret_cast<const MagickInfo*
>(mi -> next)) {
1055 kdDebug(41008) <<
"Found export filter for: " << mi -> name <<
"\n";
1059 if (mi -> encoder) {
1062 description = mi -> description;
1064 if (!description.isEmpty() && !description.contains(
'/')) {
1065 all +=
"*." + name.lower() +
" *." + name +
" ";
1066 s +=
"*." + name.lower() +
" *." + name +
"|";
1067 s += i18n(description.utf8());
1075 all +=
"|" + i18n(
"All Images");
1081#include "kis_image_magick_converter.moc"