gd

How to use GD binding in Haskell?

I've installed the GD package (http://hackage.haskell.org/package/gd-3000.4.0) using cabal. When I try to compile the program which uses GD I receive an error: [mp262554@students:~/jpp/haskell]$ ghc gd.hs compilation IS NOT required gd.o: In function `sV8_info': (.text+0x1bf): undefined reference to `gdzm3000zi4zi0_GraphicsziGD_saveJpeg...

Where can I found GD compatible fonts?

Hello there! I'm using GD to display some text. The default font is Courier (or something similar)... I want to use another font and I found this function: imageloadfont that requires a .gdf file. I've search on Google to see if I find some nice fonts, but I didn't find anything. I see there's a script to convert a PNG file to a GDF, bu...

How to Improve my php image resizer to support alpha png and transparent GIFs

Hi, I use this function to resize images but i end up with ugly creepy image with a black background if it's a transparent GIF or PNG with alpha, however it works perfectly for jpg and normal png. function cropImage($nw, $nh, $source, $stype, $dest) { $size = getimagesize($source); $w = $size[0]; $h = $size[1]; sw...

how to set the background image property of a div to a dynamically generated image

I have some divs and each one has its own background image. The base images as stored is just a black silhouette. What I would like to do is use the PHP GD package to modify the color of those images somewhat randomly and have the modified randomly coloured images be the background images of the divs. One way to do it is just crea...

Warning: Cannot modify header information - headers already sent by

When i try run this file i am getting this error. <?php $im = imagecreatetruecolor(100, 100); // sets background to red $red = imagecolorallocate($im, 255, 0, 0); imagefill($im, 0, 0, $red); header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?> Warning: Cannot modify header information - headers already sent by (ou...

Box of text in php gd

I want to make box of text having story in it...copy on image using GD library.i want it beacause i have to save image for further puporse. ...

gd enabled but still reports PHP Fatal error: Call to undefined function imagecreatefromjpeg()

Has anyone met this problem ? I've checked the output of phpinfo(),and see gd is enabled. UPDATE I built PHP with --with-gd, but only GIF Support and PNG Support are in the output of phpinfo(), how do I enable JPEG Support? ...

Cannot modify header information - headers already sent by

<?php require_once 'wordwrap.php'; $text="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum"; $im=imagecreatefrompng('testing.png'); $arr=word($text); $white = imagecolorallocate($im,255,255,255); $grey = imagecolorallocate($im, 128, 128, 128); $font='arial.ttf'; $m=121; for($i=...

imagecreatefrompng error

<?php function LoadPNG($imgname) { /* Attempt to open */ $im = @imagecreatefrompng($imgname); /* See if it failed */ if(!$im) { /* Create a blank image */ $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); ...

getting jpeg error

<?php function LoadPNG() { /* Attempt to open */ //require_once 'resizex.php'; $imgname="/home2/puneetbh/public_html/prideofhome/wp-content/uploads/268995481image_11.png"; //$im = @imagecreatefrompng($imgname); $img= imagecreatefromstring(file_get_contents($imgname)); //$im=imagecreatefrompng('images/frame.png');...

Why when i rotate the image black borders appear? PHP GD

This code generates two images using GD and rotates one of them. When I rotate the image black borders begin to appear. Anyone have an idea of how to resolve this? imagefilledrectangle($im, 0, 0, 300, 400, $black); imagefilledrectangle($im, 1, 1, 298, 398, $grey); imagefilledrectangle($im, 49, 69, 251, 271, $black); imagefilledrectang...

image position and the watermark

$path= 'system/application/'; $vendorname='mug'; $water= ''.$vendorname.'.jpg'; $config['wm_type'] = 'text'; $config['source_image'] = $path.'/images/'.$water.''; $config['new_image'] = $path.'...

imagettftext problem

<?php imagettftext($im,15,0,470,$m,$black,$font,"this is testing of all"); ?> when i run this function i got the image with uneven spaces. like this: this is testin g o fall does anybody know whats the problem is??? ...

PHP GD Allowed memory size exhausted

I'm trying to process a directory of JPEG images (roughly 600+, ranging from 50k to 500k) using PHP: GD to resize and save the images but I've hit a bit of a snag quite early in the process. After correctly processing just 3 images (30K, 18K and 231K) I get a Allowed memory size of 16777216 bytes exhausted PHP Fatal error. I'm cycling ...

Which is more efficient/faster when calling a cached image?

Hi, i made an image resizer in php. When an image is resized, it caches a new jpg file with the new dimensions. Next time you call the exact img.php?file=hello.jpg&size=400 it checks if the new jpg has already been created. If it has NOT been created yet, it creates the file and then prints the output (cool). If it ALREADY exists, no n...

Dynamic status bar image creation in php

I am new to image creation in php. If you change the param value, bar progress should also be changed to passed value How can i implement something like that? I would be grateful if anyone can shed some light Thanks for the help inadvance UPDATE: I figured it out myself, thank you Greg and all for the suggestions ... please test t...

Good way to identify similar images?

I've developed a simple and fast algorithm in PHP to compare images for similarity. Its fast (~40 per second for 800x600 images) to hash and a unoptimised search algorithm can go through 3,000 images in 22 mins comparing each one against the others (3/sec). The basic overview is you get a image, rescale it to 8x8 and then convert those...

I'm working on a website that sells different artwork, what's the best way to handle different image sizes?

I'm working on a website that will allow users to upload and sell their artwork in different sizes. I was wondering what the best way would be to handle the different file sizes automatically. A few points I was curious on: How to define different size categories (small, medium, large) in such a way that I'll be able to dynamically r...

How to create transparent watermark on an image using gdlibrary?

How to create transparent watermark on an image using gdlibrary in PHP? I water to rotate the image and tile it through out entire image also. Please anyone, could you please upload with examples? ...

Is something wrong with this php GD code?

if ($img = @imagecreatefromjpeg('./images/upload/13/1.JPG')) { imagejpeg($img, $path, 100); imagedestroy($img); } else { die ("image was not created or saved"); } I'm getting the message: Warning: imagejpeg(): 8 is not a valid Image resource in C:\xampp\htdocs\invivid\libraries\photogr...