Sign in Join
Wiki copytemporary

PascalMagick/fr: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: PascalMagick/fr

OldNewLine
1+#### Au sujet d'ImageMagick
2+
3+[ImageMagick](http://www.imagemagick.org) est une suite libre de logiciels de développement pour crée, éditer et compose des bitmaps. Il supporte un nombre énorme de format d'image (plus de 200 !) dont PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, et SVG. Les images peuvent être redimensionner, mise en miroir, tourner, déformer, cisailler et transformer. Vous pouvez ajuster les couleurs d'image, appliquer différents effets ou dessiner du texte, des lignes, des polygones, des ellipses et des courbes de Bézier.
4+
5+Cette suite tourne sur la majorité des OS (il est préinstaller sur plusieurs distibutions Linux) et peut également être utiliser en ligne de commande.
6+
7+ImageMagick dipose également de ces fonctionalité :
8+
9+- Convertir une image d'un type à l'autre (ex PNG→JPEG)
10+- Crée un montage de vignettes
11+- Il gère la transparence (utile pour le web)
12+- Peut générez des GIF à partir de plusieurs images
13+- Crée une image à partir de plusieurs
14+- Crée une bordure décorative à l'image
15+- Décrire le format et les caractéristiques de l'image
16+
17+Au fait, l'es unités de l'API sont disponibles dans 21 langages (dont le pascal)
18+
19+##### ImageMagick Book
20+
21+[ImageMagick Tricks](http://www.packtpub.com/imagemagick/book) This fast paced and practical tutorial is packed with examples of photo manipulations, logo creation, animations, and complete web projects. With this book up your sleeve, you'll be creating spellbinding images from code in no time.
22+
23+##### MagickWand
24+
25+L'[API MagickWand](http://www.imagemagick.org/script/magick-wand.php) est l'interface recommandée par l'équipe d'ImageMagick. C'est une couche entre L'application et [MagickCore](https://www.imagemagick.org/script/magick-core.php), l'API de bas niveau
26+
27+#### Licence
28+
29+ImageMagick est sous une licence du style BSD mais compatible avec la GPL.
30+
31+Vous lire la licence [ici](http://www.imagemagick.org/script/license.php).
32+
33+### Installation
34+
35+#### Installation de imagemagick.pas
36+
37+Par défaut ImageMagick est fournit avec un FPC réçent dans l'unité ImageMagick.
38+
39+Si non alors utiliser fppkg : fppkg install imagemagick
40+
41+Via svn FPC : svn checkout <http://svn.freepascal.org/svn/fpc/trunk/packages/imagemagick> imagemagick Placer alors le dossier "imagemagick" dans celui des paquets FPC (sous Linux /usr/share/fpcsrc/3.0.0/packages/). (FIXME : Non testé)
42+
43+Sinon elle est [ici](https://sourceforge.net/projects/lazarus-ccr/files/PascalMagick/) (**méthode déconseillé**). Si vous installer via cette méthode sachez que aucun paquet n'est fournie. Bien que l'installation soit dans les sources de FPC je vous conseille de crée un [[Lazarus Packages]] *(en, la version française est de toute façon actuellement en anglais et elle est meilleure, à rediger vers fr après amélioration)* et d'inclure ce qui est dans "wand" et "magick" (dans FPC les 2 parties sont mélangée dans un seul dossier)
44+
45+#### Installation des binaires
46+
47+Si ImageMagick n'est pas installée chez vous allez directement sur leur [page de téléchargement](https://www.imagemagick.org/script/binary-releases.php)
48+
49+Si vous vous êtes sous Debian installer le paquet imagemagick.
50+
51+### Démo
52+
53+Placer dans dossier le programme et des PNG (extension .png et non .PNG si vous êtes sous Linux à cause de la sensibilité à la casse). Au lancement il va redimensionner les PNG vers du 106 par 80 et les convertir en jpeg (.jpg)
54+
55+ {
56+ Demonstration program for the ImageMagick Library
57+
58+ This program was converted from c by: Felipe Monteiro de Carvalho
59+
60+ Usage: Just execute the program. It will resize the image.png image
61+ on it´s directory to fit (106, 80) and convert it to a jpg.
62+
63+ Dez/2005
64+ }
65+ {Version 0.1}
66+ program wanddemo;
67+
68+ {$mode objfpc}{$H+}
69+
70+ uses SysUtils, magick_wand, ImageMagick;
71+
72+ procedure ThrowWandException(wand: PMagickWand);
73+ var
74+ description: PChar;
75+ severity: ExceptionType;
76+ begin
77+ description := MagickGetException(wand, @severity);
78+ WriteLn(Format('An error ocurred. Description: %s', [description]));
79+ description := MagickRelinquishMemory(description);
80+ Abort;
81+ end;
82+
83+ var
84+ status: MagickBooleanType;
85+ wand: PMagickWand;
86+ begin
87+ { Read an image. }
88+
89+ MagickWandGenesis;
90+
91+ wand := NewMagickWand;
92+
93+ try
94+ status := MagickReadImage(wand, 'image.png');
95+ if (status = MagickFalse) then ThrowWandException(wand);
96+
97+ { Turn the images into a thumbnail sequence. }
98+
99+ MagickResetIterator(wand);
100+
101+ while (MagickNextImage(wand) <> MagickFalse) do
102+ MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0);
103+
104+ { Write the image as MIFF and destroy it. }
105+
106+ status := MagickWriteImages(wand, 'image.jpg', MagickTrue);
107+ if (status = MagickFalse) then ThrowWandException(wand);
108+
109+ finally
110+ wand := DestroyMagickWand(wand);
111+
112+ MagickWandTerminus;
113+ end;
114+ end.
115+
116+### Bug Reporting/Feature Request
117+
118+Tests are necessary to verify if the bindings work with all versions of ImageMagick.
119+
120+You can post Bug Reports / Feature Requests here:
121+
122+------------------------------------------------------------------------
123+
124+**Bug 1**
125+
126+There is an error in pixel_iterator.inc The correct declaration is function NewPixelIterator(wand: PMagickWand): PPixelIterator; cdecl; external WandExport;
127+
128+also the following declarations should be added function PixelGetNextIteratorRow(iterator: PPixeliterator; var wandCount : Cardinal) : PPPixelWand; cdecl; external WandExport;
129+
130+function PixelGetPreviousIteratorRow(iterator: PPixeliterator; var wandCount : Cardinal) : PPPixelWand; cdecl; external WandExport;
131+
132+Cheers, Todd.
133+
134+**Status**: Fixed on 0.3
135+
136+------------------------------------------------------------------------
137+
138+**Bug 2**
139+
140+There is a problem in "magick_wand.pas" and "ImageMagick.pas": the compiler option "{\$PACKRECORDS C}" must be in the "{\$ifdef FPC}\[...\]{\$endif}". Otherwise the units do not compile with Delphi (Delphi 7 in my case).
141+
142+Best wishes, Marc Geldon ([PRO IT SYSTEMS](http://www.proitsystems.de))
143+
144+------------------------------------------------------------------------
145+
146+**Bug 3**
147+
148+your definition of "MagickGetImagePage" in magick_image.inc:
149+
150+ function MagickGetImagePage(wand: PMagickWand; width, height: PCardinal; x, y: Integer): MagickBooleanType; cdecl; external WandExport;
151+
152+correct definition (x and y are "PInteger"!):
153+
154+ function MagickGetImagePage(wand: PMagickWand; width, height: PCardinal; x, y: PInteger): MagickBooleanType; cdecl; external WandExport;
155+
156+Best wishes, Marc Geldon ([PRO IT SYSTEMS](http://www.proitsystems.de))
157+
158+------------------------------------------------------------------------
159+
160+**Bug 4**
161+
162+ImageMagick 6.2.7 (don't know exactly what version) introduced a few changes in MagickWand record and others. Also, a few variable definitions were incorrectly declared, and some function imports missed the "cdecl", so they didn't work (like NewMagickWand()). I've fixed all this issues. Can I upload the changes somewhere?
163+
164+Best regards, Arcnor
165+
166+
167+Hello, you can send it to me, and I´ll apply the changes. My e-mail is felipemonteiro.carvalho@gmail.com By the way, did you correct bugs 2 and 3 also? thanks a lot --Sekelsenmat 05:07, 8 June 2006 (CEST)
168+
169+------------------------------------------------------------------------
170+
171+**Bug 5**
172+
173+MagickNewImage parameters convention is cdecl.
174+
175+Correct definition of MagickNewImage in magick_image.inc:
176+
177+ function MagickNewImage(wand: PMagickWand; const columns, rows: Cardinal;
178+ const background: PPixelWand): MagickBooleanType; cdecl; external WandExport;
179+
180+------------------------------------------------------------------------
181+
182+**Bug 6**
183+
184+MagickCompositeImage : Composite_wand is a PMagickWand constant.
185+
186+Correct definition of MagickCompositeImage in magick_image.inc:
187+
188+ function MagickCompositeImage(wand: PMagickWand; const composite_wand: PMagickWand;
189+ const compose: CompositeOperator; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
190+
191+--RuBBeR 18:03, 3 July 2006 (CEST)
192+
193+'''Status: Bugs 2-6 fixed on v0.4. Thanks to all (Arcnor)
194+
195+### Change Log
196+
197+- 12.07.06 PascalMagick version 0.4 released
198+
199+1. Last bugs fixed
200+
201+- 24.05.06 PascalMagick version 0.3 released
202+
203+1. Minor fixes on the bindings
204+
205+- 10.04.06 PascalMagick version 0.2 released
206+
207+1. MagickWand API fully translated
208+2. Added a second demonstration program
209+
210+- 27.12.05 PascalMagick version 0.1 released
211+
212+1. About 80% of the MagickWand API is translated
213+2. The basic demonstration program is working well
214+3. Only the very minimum necessary MagickCode headers were translated
215+
216+- 14.12.05 Began working on a pascal port for the c headers
217+
218+### Help
219+
220+Please send help requests to the Lazarus Forum or the Lazarus mailling list.
221+
222+---
223+*From the Free Pascal wiki, page "PascalMagick/fr", as it stood on 2016-11-20 after a change by MiniApp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history