Sign in Join
Wiki copytemporary

PascalMagick/pt: what changed

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

Title: PascalMagick/pt

OldNewLine
1+### Sobre
2+
3+#### Sobre o ImageMagick
4+
5+[ImageMagick](http://www.imagemagick.org) é uma suite aberta desenvolvida para criar, editar e compor imagens de bitmap. Ele tem suporte a uma grande variedade de formatos (mais de 90) inclusive GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF e DPX. As imagens podem ser cortadas, as cores podem ser mudadas, vários efeitos podem ser aplicados, as imagens podem ser giradas ou combinadas e texto, linhas, polígonos, elipses e curvas Bézier podem ser adicionadas às imagens, esticadas ou giradas.
6+
7+A Suite corre em todos os grandes sistemas operativos e pode ser também utilizada através da linha de comandos. O pacote da linha de comandos é dos pacotes standart do Linux, sendo distribuidos com muitas das distros.
8+
9+Features :
10+
11+- Converte uma imagem entre vários formatos (e.g. PNG to JPEG)
12+- Redimenciona, roda, sharpen, reduz a cor ou adiciona efeitos especiais a uma imagem;
13+- Cria thumbnails das imagens;
14+- Cria imagens transparentes, apropriadas para a web;
15+- Transforma um grupo de imagens num GIF animado;
16+
17+- Create a composite image by combining several separate image
18+- Draw shapes or text on an image
19+- Decorate an image with a border or frame
20+- Describe the format and characteristics of an image
21+
22+#### ImageMagick Book
23+
24+[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.
25+
26+#### About MagickWand
27+
28+The [MagickWand API](http://www.imagemagick.org/script/magick-wand.php) is the recommended interface by the ImageMagick team. It is an easy to use programming interface for using the suite.
29+
30+#### About MagickCore
31+
32+The MagickCore API is a low-level interface for ImageMagick.
33+
34+#### About PascalMagick
35+
36+This port is a translation of the c header files for both MagickWand and Magick Core.
37+
38+### Screenshot
39+
40+### Authors
41+
42+Felipe Monteiro de Carvalho
43+
44+Ángel Eduardo García
45+
46+### License
47+
48+BSD-style and compatible with the GPL.
49+
50+You can read the Licence [here](http://www.imagemagick.org/script/license.php).
51+
52+### Download
53+
54+PascalMagick 0.4 is available here: <http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=174103&release_id=431432>
55+
56+Status: Magick Wand headers are complete and working on both Windows and Linux.
57+
58+### Installation
59+
60+The current version of PascalMagick works on Windows and Linux. Beta testers are necessary for the Mac OS X version.
61+
62+To start with, install ImageMagick binaries from the official website: <http://www.imagemagick.org/script/binary-releases.php>
63+
64+Now download and unzip PascalMagick package (Instructions on the Download section above).
65+
66+To check that everything is working, open the PascalMagick/wand/wanddemo.lpi project. Now go to the Project --\> "Compiler Options dialog" and change the "Other Units" field to point to "../magick", so it can find the PascalMagick/magick/ImageMagick.pas file. After this you can compile and run the test program.
67+
68+If the program is working, it will load the image.png image located on the same directory as he is, resize it and then save it as a jpg called image.jpg.
69+
70+One Extra step is necessary on Linux: Rename the image.PNG to image.png due to case issues.
71+
72+### Demonstration program 1
73+
74+ {
75+ Demonstration program for the ImageMagick Library
76+
77+ This program was converted from C by Felipe Monteiro de Carvalho.
78+
79+ Usage: Just execute the program. It will resize the image.png image
80+ on its directory to fit (106, 80) and convert it to a jpg.
81+
82+ Dez/2005
83+ }
84+ {Version 0.1}
85+ program wanddemo;
86+
87+ {$mode objfpc}{$H+}
88+
89+ uses SysUtils, magick_wand, ImageMagick;
90+
91+ procedure ThrowWandException(wand: PMagickWand);
92+ var
93+ description: PChar;
94+ severity: ExceptionType;
95+ begin
96+ description := MagickGetException(wand, @severity);
97+ WriteLn(Format('An error ocurred. Description: %s', [description]));
98+ description := MagickRelinquishMemory(description);
99+ Abort;
100+ end;
101+
102+ var
103+ status: MagickBooleanType;
104+ wand: PMagickWand;
105+ begin
106+ { Read an image. }
107+
108+ MagickWandGenesis;
109+
110+ wand := NewMagickWand;
111+
112+ try
113+ status := MagickReadImage(wand, 'image.png');
114+ if (status = MagickFalse) then ThrowWandException(wand);
115+
116+ { Turn the images into a thumbnail sequence. }
117+
118+ MagickResetIterator(wand);
119+
120+ while (MagickNextImage(wand) <> MagickFalse) do
121+ MagickResizeImage(wand, 106, 80, LanczosFilter, 1.0);
122+
123+ { Write the image as MIFF and destroy it. }
124+
125+ status := MagickWriteImages(wand, 'image.jpg', MagickTrue);
126+ if (status = MagickFalse) then ThrowWandException(wand);
127+
128+ finally
129+ wand := DestroyMagickWand(wand);
130+
131+ MagickWandTerminus;
132+ end;
133+ end.
134+
135+### Subversion
136+
137+You can download the subversion version of this project using this command:
138+
139+svn checkout <http://svn.freepascal.org/svn/fpc/trunk/packages/base/imagemagick> imagemagick
140+
141+You can also download the full fpc 2.1.1 repository and it will be included.
142+
143+### Bug Reporting/Feature Request
144+
145+Tests are necessary to verify if the bindings work with all versions of ImageMagick.
146+
147+You can post Bug Reports / Feature Requests here:
148+
149+------------------------------------------------------------------------
150+
151+**Bug 1**
152+
153+There is an error in pixel_iterator.inc The correct declaration is function NewPixelIterator(wand: PMagickWand): PPixelIterator; cdecl; external WandExport;
154+
155+also the following declarations should be added function PixelGetNextIteratorRow(iterator: PPixeliterator; var wandCount : Cardinal) : PPPixelWand; cdecl; external WandExport;
156+
157+function PixelGetPreviousIteratorRow(iterator: PPixeliterator; var wandCount : Cardinal) : PPPixelWand; cdecl; external WandExport;
158+
159+Cheers, Todd.
160+
161+**Status**: Fixed on 0.3
162+
163+------------------------------------------------------------------------
164+
165+**Bug 2**
166+
167+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).
168+
169+Best wishes, Marc Geldon ([PRO IT SYSTEMS](http://www.proitsystems.de))
170+
171+------------------------------------------------------------------------
172+
173+**Bug 3**
174+
175+your definition of "MagickGetImagePage" in magick_image.inc:
176+
177+ function MagickGetImagePage(wand: PMagickWand; width, height: PCardinal; x, y: Integer): MagickBooleanType; cdecl; external WandExport;
178+
179+correct definition (x and y are "PInteger"!):
180+
181+ function MagickGetImagePage(wand: PMagickWand; width, height: PCardinal; x, y: PInteger): MagickBooleanType; cdecl; external WandExport;
182+
183+Best wishes, Marc Geldon ([PRO IT SYSTEMS](http://www.proitsystems.de))
184+
185+------------------------------------------------------------------------
186+
187+**Bug 4**
188+
189+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?
190+
191+Best regards, Arcnor
192+
193+
194+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)
195+
196+------------------------------------------------------------------------
197+
198+**Bug 5**
199+
200+MagickNewImage parameters convention is cdecl.
201+
202+Correct definition of MagickNewImage in magick_image.inc:
203+
204+ function MagickNewImage(wand: PMagickWand; const columns, rows: Cardinal;
205+ const background: PPixelWand): MagickBooleanType; cdecl; external WandExport;
206+
207+------------------------------------------------------------------------
208+
209+**Bug 6**
210+
211+MagickCompositeImage : Composite_wand is a PMagickWand constant.
212+
213+Correct definition of MagickCompositeImage in magick_image.inc:
214+
215+ function MagickCompositeImage(wand: PMagickWand; const composite_wand: PMagickWand;
216+ const compose: CompositeOperator; const x, y: Integer): MagickBooleanType; cdecl; external WandExport;
217+
218+--RuBBeR 18:03, 3 July 2006 (CEST)
219+
220+'''Status: Bugs 2-6 fixed on v0.4. Thanks to all (Arcnor)
221+
222+### Change Log
223+
224+- 12.07.06 PascalMagick version 0.4 released
225+
226+1. Last bugs fixed
227+
228+- 24.05.06 PascalMagick version 0.3 released
229+
230+1. Minor fixes on the bindings
231+
232+- 10.04.06 PascalMagick version 0.2 released
233+
234+1. MagickWand API fully translated
235+2. Added a second demonstration program
236+
237+- 27.12.05 PascalMagick version 0.1 released
238+
239+1. About 80% of the MagickWand API is translated
240+2. The basic demonstration program is working well
241+3. Only the very minimum necessary MagickCode headers were translated
242+
243+- 14.12.05 Began working on a pascal port for the c headers
244+
245+### Help
246+
247+Please send help requests to the Lazarus Forum or the Lazarus mailling list.
248+
249+---
250+*From the Free Pascal wiki, page "PascalMagick/pt", as it stood on 2015-02-08 after a change by BlaiseP, 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