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();
260 InitializeMagick(*app -> argv());
261 atexit(DestroyMagick);
277 MagickBooleanType monitor(
const char *text,
const ExtendedSignedIntegralType,
const ExtendedUnsignedIntegralType, ExceptionInfo *)
279 TDEApplication *app = TDEApplication::kApplication();
283 if (app -> hasPendingEvents())
284 app -> processEvents();
286 printf(
"%s\n", text);
290 unsigned int monitor(
const char *text,
const ExtendedSignedIntegralType,
const ExtendedUnsignedIntegralType, ExceptionInfo *)
292 TDEApplication *app = TDEApplication::kApplication();
296 if (app -> hasPendingEvents())
297 app -> processEvents();
299 printf(
"%s\n", text);
306KisImageMagickConverter::KisImageMagickConverter(KisDoc *doc, KisUndoAdapter *adapter)
310 SetMonitorHandler(monitor);
314KisImageMagickConverter::~KisImageMagickConverter()
318KisImageBuilder_Result KisImageMagickConverter::decode(
const KURL& uri,
bool isBlob)
327 return KisImageBuilder_RESULT_INTR;
330 GetExceptionInfo(&ei);
331 ii = CloneImageInfo(0);
336 Q_ASSERT(uri.isEmpty());
337 images = BlobToImage(ii, &m_data[0], m_data.size(), &ei);
340 tqstrncpy(ii -> filename, TQFile::encodeName(uri.path()), MaxTextExtent - 1);
342 if (ii -> filename[MaxTextExtent - 1]) {
343 emit notifyProgressError();
344 return KisImageBuilder_RESULT_PATH;
347 images = ReadImage(ii, &ei);
351 if (ei.severity != UndefinedException)
355 DestroyImageInfo(ii);
356 DestroyExceptionInfo(&ei);
357 emit notifyProgressError();
358 return KisImageBuilder_RESULT_FAILURE;
361 emit notifyProgressStage(i18n(
"Importing..."), 0);
365 while ((image = RemoveFirstImageFromList(&images))) {
366 ViewInfo *vi = OpenCacheView(image);
369 unsigned long imageDepth = image->depth;
370 kdDebug(41008) <<
"Image depth: " << imageDepth <<
"\n";
373 KisColorSpace * cs = 0;
374 ColorspaceType colorspaceType;
377 if (GetImageType(image, &ei) == GrayscaleType || GetImageType(image, &ei) == GrayscaleMatteType) {
380 else if ( imageDepth == 16 )
382 colorspaceType = GRAYColorspace;
385 colorspaceType = image->colorspace;
386 csName = getColorSpaceName(image -> colorspace, imageDepth);
389 kdDebug(41008) <<
"image has " << csName <<
" colorspace\n";
391 KisProfile * profile = getProfileForProfileInfo(image);
394 kdDebug(41008) <<
"image has embedded profile: " << profile -> productName() <<
"\n";
395 cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(csName, profile);
398 cs = KisMetaRegistry::instance()->csRegistry()->getColorSpace(KisID(csName,
""),
"");
401 kdDebug(41008) <<
"Chalk does not support colorspace " << image -> colorspace <<
"\n";
404 DestroyExceptionInfo(&ei);
405 DestroyImageList(images);
406 DestroyImageInfo(ii);
407 emit notifyProgressError();
408 return KisImageBuilder_RESULT_UNSUPPORTED_COLORSPACE;
412 m_img =
new KisImage(m_doc->undoAdapter(), image -> columns, image -> rows, cs,
"built image");
414 m_img->blockSignals(
true);
417 setAnnotationsForImage(image, m_img);
420 if (image -> columns && image -> rows) {
423 TQ_UINT8 opacity = OPACITY_OPAQUE;
424 const ImageAttribute * attr = GetImageAttribute(image,
"[layer-opacity]");
426 opacity = TQ_UINT8_MAX - Downscale(TQString(attr->value).toInt());
429 KisPaintLayerSP layer = 0;
431 attr = GetImageAttribute(image,
"[layer-name]");
433 layer =
new KisPaintLayer(m_img, attr->value, opacity);
436 layer =
new KisPaintLayer(m_img, m_img -> nextLayerName(), opacity);
442 TQ_INT32 x_offset = 0;
443 TQ_INT32 y_offset = 0;
445 attr = GetImageAttribute(image,
"[layer-xpos]");
447 x_offset = TQString(attr->value).toInt();
450 attr = GetImageAttribute(image,
"[layer-ypos]");
452 y_offset = TQString(attr->value).toInt();
456 for (TQ_UINT32 y = 0; y < image->rows; y ++)
458 const PixelPacket *pp = AcquireCacheView(vi, 0, y, image->columns, 1, &ei);
463 DestroyImageList(images);
464 DestroyImageInfo(ii);
465 DestroyExceptionInfo(&ei);
466 emit notifyProgressError();
467 return KisImageBuilder_RESULT_FAILURE;
470 IndexPacket * indexes = GetCacheViewIndexes(vi);
472 KisHLineIteratorPixel hiter = layer->paintDevice()->createHLineIterator(0, y, image->columns,
true);
474 if (colorspaceType== CMYKColorspace) {
475 if (imageDepth == 8) {
477 while (!hiter.isDone())
479 TQ_UINT8 *ptr= hiter.rawData();
480 *(ptr++) = Downscale(pp->red);
481 *(ptr++) = Downscale(pp->green);
482 *(ptr++) = Downscale(pp->blue);
483 *(ptr++) = Downscale(indexes[x]);
486 if (image->matte != MagickFalse) {
488 if (image->matte ==
true) {
490 *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
493 *(ptr++) = OPACITY_OPAQUE;
501 else if (colorspaceType == LABColorspace) {
502 while(! hiter.isDone())
504 TQ_UINT16 *ptr =
reinterpret_cast<TQ_UINT16 *
>(hiter.rawData());
506 *(ptr++) = ScaleQuantumToShort(pp->red);
507 *(ptr++) = ScaleQuantumToShort(pp->green);
508 *(ptr++) = ScaleQuantumToShort(pp->blue);
509 *(ptr++) = 65535 - ScaleQuantumToShort(pp->opacity);
515 else if (colorspaceType == RGBColorspace ||
516 colorspaceType == sRGBColorspace ||
517 colorspaceType == TransparentColorspace)
519 if (imageDepth == 8) {
520 while(! hiter.isDone())
522 TQ_UINT8 *ptr= hiter.rawData();
524 *(ptr++) = Downscale(pp->blue);
525 *(ptr++) = Downscale(pp->green);
526 *(ptr++) = Downscale(pp->red);
527 *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
533 else if (imageDepth == 16) {
534 while(! hiter.isDone())
536 TQ_UINT16 *ptr =
reinterpret_cast<TQ_UINT16 *
>(hiter.rawData());
538 *(ptr++) = ScaleQuantumToShort(pp->blue);
539 *(ptr++) = ScaleQuantumToShort(pp->green);
540 *(ptr++) = ScaleQuantumToShort(pp->red);
541 *(ptr++) = 65535 - ScaleQuantumToShort(pp->opacity);
548 else if ( colorspaceType == GRAYColorspace) {
549 if (imageDepth == 8) {
550 while(! hiter.isDone())
552 TQ_UINT8 *ptr= hiter.rawData();
554 *(ptr++) = Downscale(pp->blue);
555 *(ptr++) = OPACITY_OPAQUE - Downscale(pp->opacity);
561 else if (imageDepth == 16) {
562 while(! hiter.isDone())
564 TQ_UINT16 *ptr =
reinterpret_cast<TQ_UINT16 *
>(hiter.rawData());
566 *(ptr++) = ScaleQuantumToShort(pp->blue);
567 *(ptr++) = 65535 - ScaleQuantumToShort(pp->opacity);
575 emit notifyProgress(y * 100 / image->rows);
580 DestroyImageList(images);
581 DestroyImageInfo(ii);
582 DestroyExceptionInfo(&ei);
584 return KisImageBuilder_RESULT_INTR;
587 m_img->addLayer(layer.data(), m_img->rootLayer());
588 layer->paintDevice()->move(x_offset, y_offset);
591 emit notifyProgressDone();
596 emit notifyProgressDone();
597 DestroyImageList(images);
598 DestroyImageInfo(ii);
599 DestroyExceptionInfo(&ei);
600 return KisImageBuilder_RESULT_OK;
603 KisImageBuilder_Result KisImageMagickConverter::buildImage(
const KURL& uri)
606 return KisImageBuilder_RESULT_NO_URI;
608 if (!TDEIO::NetAccess::exists(uri,
false, tqApp -> mainWidget())) {
609 return KisImageBuilder_RESULT_NOT_EXIST;
612 KisImageBuilder_Result result = KisImageBuilder_RESULT_FAILURE;
615 if (TDEIO::NetAccess::download(uri, tmpFile, tqApp -> mainWidget())) {
617 uriTF.setPath( tmpFile );
618 result = decode(uriTF,
false);
619 TDEIO::NetAccess::removeTempFile(tmpFile);
626 KisImageSP KisImageMagickConverter::image()
631 void KisImageMagickConverter::init(KisDoc *doc, KisUndoAdapter *adapter)
638 KisImageBuilder_Result KisImageMagickConverter::buildFile(
const KURL& uri, KisPaintLayerSP layer, vKisAnnotationSP_it annotationsStart, vKisAnnotationSP_it annotationsEnd)
645 return KisImageBuilder_RESULT_INVALID_ARG;
647 KisImageSP img = layer->image();
649 return KisImageBuilder_RESULT_EMPTY;
652 return KisImageBuilder_RESULT_NO_URI;
654 if (!uri.isLocalFile())
655 return KisImageBuilder_RESULT_NOT_LOCAL;
658 TQ_UINT32 layerBytesPerChannel = layer->paintDevice()->pixelSize() / layer->paintDevice()->nChannels();
660 GetExceptionInfo(&ei);
662 ii = CloneImageInfo(0);
664 tqstrncpy(ii -> filename, TQFile::encodeName(uri.path()), MaxTextExtent - 1);
666 if (ii -> filename[MaxTextExtent - 1]) {
667 emit notifyProgressError();
668 return KisImageBuilder_RESULT_PATH;
671 if (!img -> width() || !img -> height())
672 return KisImageBuilder_RESULT_EMPTY;
674 if (layerBytesPerChannel < 2) {
681 ii->colorspace = getColorTypeforColorSpace(layer->paintDevice()->colorSpace());
683 image = AllocateImage(ii);
684 SetImageColorspace(image, ii->colorspace);
685 image -> columns = img -> width();
686 image -> rows = img -> height();
688 kdDebug(41008) <<
"Saving with colorspace " << image->colorspace <<
", (" << layer->paintDevice()->colorSpace()->id().name() <<
")\n";
689 kdDebug(41008) <<
"IM Image thinks it has depth: " << image->depth <<
"\n";
693 image -> matte = MagickTrue;
698 image -> matte =
true;
701 TQ_INT32 y, height, width;
703 height = img -> height();
704 width = img -> width();
707 TQString ext = TQFileInfo(TQFile::encodeName(uri.path())).extension(
false).upper();
710 tqstrncpy(ii->magick,
"BMP2", MaxTextExtent - 1);
712 else if (ext ==
"RGB") {
713 tqstrncpy(ii->magick,
"SGI", MaxTextExtent - 1);
716 for (y = 0; y < height; y++) {
719 PixelPacket * pp = SetImagePixels(image, 0, y, width, 1);
722 DestroyExceptionInfo(&ei);
724 emit notifyProgressError();
725 return KisImageBuilder_RESULT_FAILURE;
729 KisHLineIterator it = layer->paintDevice()->createHLineIterator(0, y, width,
false);
731 SetImageType(image, TrueColorMatteType);
733 SetImageType(image, TrueColorType);
735 if (image->colorspace== CMYKColorspace) {
737 IndexPacket * indexes = GetIndexes(image);
739 if (layerBytesPerChannel == 2) {
740 while (!it.isDone()) {
742 const TQ_UINT16 *d =
reinterpret_cast<const TQ_UINT16 *
>(it.rawData());
743 pp -> red = ScaleShortToQuantum(d[PIXEL_CYAN]);
744 pp -> green = ScaleShortToQuantum(d[PIXEL_MAGENTA]);
745 pp -> blue = ScaleShortToQuantum(d[PIXEL_YELLOW]);
747 pp -> opacity = ScaleShortToQuantum(65535 - d[PIXEL_CMYK_ALPHA]);
748 indexes[x] = ScaleShortToQuantum(d[PIXEL_BLACK]);
755 while (!it.isDone()) {
757 TQ_UINT8 * d = it.rawData();
758 pp -> red = Upscale(d[PIXEL_CYAN]);
759 pp -> green = Upscale(d[PIXEL_MAGENTA]);
760 pp -> blue = Upscale(d[PIXEL_YELLOW]);
762 pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_CMYK_ALPHA]);
764 indexes[x]= Upscale(d[PIXEL_BLACK]);
772 else if (image->colorspace== RGBColorspace ||
773 image->colorspace == sRGBColorspace ||
774 image->colorspace == TransparentColorspace)
776 if (layerBytesPerChannel == 2) {
777 while (!it.isDone()) {
779 const TQ_UINT16 *d =
reinterpret_cast<const TQ_UINT16 *
>(it.rawData());
780 pp -> red = ScaleShortToQuantum(d[PIXEL_RED]);
781 pp -> green = ScaleShortToQuantum(d[PIXEL_GREEN]);
782 pp -> blue = ScaleShortToQuantum(d[PIXEL_BLUE]);
784 pp -> opacity = ScaleShortToQuantum(65535 - d[PIXEL_ALPHA]);
791 while (!it.isDone()) {
793 TQ_UINT8 * d = it.rawData();
794 pp -> red = Upscale(d[PIXEL_RED]);
795 pp -> green = Upscale(d[PIXEL_GREEN]);
796 pp -> blue = Upscale(d[PIXEL_BLUE]);
798 pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_ALPHA]);
805 else if (image->colorspace == GRAYColorspace)
807 SetImageType(image, GrayscaleMatteType);
808 if (layerBytesPerChannel == 2) {
809 while (!it.isDone()) {
811 const TQ_UINT16 *d =
reinterpret_cast<const TQ_UINT16 *
>(it.rawData());
812 pp -> red = ScaleShortToQuantum(d[PIXEL_GRAY]);
813 pp -> green = ScaleShortToQuantum(d[PIXEL_GRAY]);
814 pp -> blue = ScaleShortToQuantum(d[PIXEL_GRAY]);
816 pp -> opacity = ScaleShortToQuantum(65535 - d[PIXEL_GRAY_ALPHA]);
823 while (!it.isDone()) {
824 TQ_UINT8 * d = it.rawData();
825 pp -> red = Upscale(d[PIXEL_GRAY]);
826 pp -> green = Upscale(d[PIXEL_GRAY]);
827 pp -> blue = Upscale(d[PIXEL_GRAY]);
829 pp -> opacity = Upscale(OPACITY_OPAQUE - d[PIXEL_GRAY_ALPHA]);
837 kdDebug(41008) <<
"Unsupported image format\n";
838 return KisImageBuilder_RESULT_INVALID_ARG;
841 emit notifyProgressStage(i18n(
"Saving..."), y * 100 / height);
844 if (SyncImagePixels(image) == MagickFalse)
845 kdDebug(41008) <<
"Syncing pixels failed\n";
847 if (!SyncImagePixels(image))
848 kdDebug(41008) <<
"Syncing pixels failed\n";
853 exportAnnotationsForImage(image, annotationsStart, annotationsEnd);
858 WriteImage(ii, image);
859 DestroyExceptionInfo(&ei);
861 emit notifyProgressDone();
862 return KisImageBuilder_RESULT_OK;
865 void KisImageMagickConverter::ioData(TDEIO::Job *job,
const TQByteArray& data)
867 if (data.isNull() || data.isEmpty()) {
868 emit notifyProgressStage(i18n(
"Loading..."), 0);
872 if (m_data.empty()) {
877 ii = CloneImageInfo(0);
878 GetExceptionInfo(&ei);
879 image = PingBlob(ii, data.data(), data.size(), &ei);
881 if (image == 0 || ei.severity == BlobError) {
882 DestroyExceptionInfo(&ei);
883 DestroyImageInfo(ii);
885 emit notifyProgressError();
890 DestroyExceptionInfo(&ei);
891 DestroyImageInfo(ii);
892 emit notifyProgressStage(i18n(
"Loading..."), 0);
895 Q_ASSERT(data.size() + m_data.size() <= m_size);
896 memcpy(&m_data[m_data.size()], data.data(), data.count());
897 m_data.resize(m_data.size() + data.count());
898 emit notifyProgressStage(i18n(
"Loading..."), m_data.size() * 100 / m_size);
904 void KisImageMagickConverter::ioResult(TDEIO::Job *job)
909 emit notifyProgressError();
911 decode(KURL(),
true);
914 void KisImageMagickConverter::ioTotalSize(TDEIO::Job * , TDEIO::filesize_t size)
917 m_data.reserve(size);
918 emit notifyProgressStage(i18n(
"Loading..."), 0);
921 void KisImageMagickConverter::cancel()
930 TQString KisImageMagickConverter::readFilters()
935 TQString description;
936 unsigned long matches;
939#ifdef HAVE_OLD_GETMAGICKINFOLIST
940 const MagickInfo **mi;
941 mi = GetMagickInfoList(
"*", &matches);
944 GetExceptionInfo(&ei);
945 const MagickInfo **mi;
946 mi = GetMagickInfoList(
"*", &matches, &ei);
947 DestroyExceptionInfo(&ei);
950 const MagickInfo *mi;
952 GetExceptionInfo(&ei);
953 mi = GetMagickInfo(
"*", &ei);
954 DestroyExceptionInfo(&ei);
961 for (
unsigned long i = 0; i < matches; i++) {
962 const MagickInfo *info = mi[i];
966 if (info -> decoder) {
968 description = info -> description;
969 kdDebug(41008) <<
"Found import filter for: " << name <<
"\n";
971 if (!description.isEmpty() && !description.contains(
'/')) {
972 all +=
"*." + name.lower() +
" *." + name +
" ";
973 s +=
"*." + name.lower() +
" *." + name +
"|";
974 s += i18n(description.utf8());
980 for (; mi; mi =
reinterpret_cast<const MagickInfo*
>(mi -> next)) {
985 description = mi -> description;
986 kdDebug(41008) <<
"Found import filter for: " << name <<
"\n";
988 if (!description.isEmpty() && !description.contains(
'/')) {
989 all +=
"*." + name.lower() +
" *." + name +
" ";
990 s +=
"*." + name.lower() +
" *." + name +
"|";
991 s += i18n(description.utf8());
998 all +=
"|" + i18n(
"All Images");
1004 TQString KisImageMagickConverter::writeFilters()
1009 TQString description;
1010 unsigned long matches;
1013#ifdef HAVE_OLD_GETMAGICKINFOLIST
1014 const MagickInfo **mi;
1015 mi = GetMagickInfoList(
"*", &matches);
1018 GetExceptionInfo(&ei);
1019 const MagickInfo **mi;
1020 mi = GetMagickInfoList(
"*", &matches, &ei);
1021 DestroyExceptionInfo(&ei);
1024 const MagickInfo *mi;
1026 GetExceptionInfo(&ei);
1027 mi = GetMagickInfo(
"*", &ei);
1028 DestroyExceptionInfo(&ei);
1032 kdDebug(41008) <<
"Eek, no magick info!\n";
1037 for (
unsigned long i = 0; i < matches; i++) {
1038 const MagickInfo *info = mi[i];
1039 kdDebug(41008) <<
"Found export filter for: " << info -> name <<
"\n";
1040 if (info -> stealth)
1043 if (info -> encoder) {
1044 name = info -> name;
1046 description = info -> description;
1048 if (!description.isEmpty() && !description.contains(
'/')) {
1049 all +=
"*." + name.lower() +
" *." + name +
" ";
1050 s +=
"*." + name.lower() +
" *." + name +
"|";
1051 s += i18n(description.utf8());
1057 for (; mi; mi =
reinterpret_cast<const MagickInfo*
>(mi -> next)) {
1058 kdDebug(41008) <<
"Found export filter for: " << mi -> name <<
"\n";
1062 if (mi -> encoder) {
1065 description = mi -> description;
1067 if (!description.isEmpty() && !description.contains(
'/')) {
1068 all +=
"*." + name.lower() +
" *." + name +
" ";
1069 s +=
"*." + name.lower() +
" *." + name +
"|";
1070 s += i18n(description.utf8());
1078 all +=
"|" + i18n(
"All Images");
1084#include "kis_image_magick_converter.moc"