showing an image directly

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Locked
mediman

showing an image directly

Post by mediman »

in gd it is posible to show an image directly

i.e.

Code: Select all

ImagePNG($ressource);
and no image will be saved on disk ...

now my question: is there a similar function for IM?

as far as i know display works only with x-server ...

thx in advance

mediman

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

You can display an image directly with the DisplayImage() method (depends on the language interface) but it does require an X11 server.

User avatar
anthony
Posts: 8884
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Under PHP, you will need to either have a command output to stdout at the right place (tricky), or convert the image into a 'blob' and print that at the right point.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

mediman

Post by mediman »

anthony wrote: Under PHP, you will need to either have a command output to stdout at the right place (tricky), or convert the image into a 'blob' and print that at the right point.


is there for one of the both methodes a demo avaiable (php 4.4.2) ???
or is creating a temp file and unlink it inmediately the better way?

i need this for a captcha code ...

many thanks

mediman

ridera

Post by ridera »

I wasn't able to get the temp file approach to work.

Appearently, the code unlinked the file before it was finished being sent to the client.

I even tried using sleep(); but, didn't work.

mediman

Post by mediman »

maybe this

Code: Select all

Header ...
php://stdout 
will be the best method for temporarly images like captchas ...

Here a little Codesnippet, but didn´t work :(

Code: Select all

<?
header ("Content-type: image/png");
$blah = "convert -background none -fill gold -font /usr/local/gdfonts/candice.ttf -pointsize 56  label: Testtext";
$blah .= " \( +clone  -fx A +matte -blur 0x8  -shade 110x45  -normalize -fx '3.5u^3 - 5.05u^2 + 2.05u + 0.3' +clone  -compose Overlay -composite \)"; 
$blah .= " -matte  -compose In  -composite php://stdout";
exec($blah);
?> 
Anyone please?

Locked