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...
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...
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...
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...
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...
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.
...
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?
...
<?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=...
<?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);
...
<?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');...
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...
$path= 'system/application/';
$vendorname='mug';
$water= ''.$vendorname.'.jpg';
$config['wm_type'] = 'text';
$config['source_image'] = $path.'/images/'.$water.'';
$config['new_image'] = $path.'...
<?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???
...
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 ...
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...
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...
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 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 in PHP? I water to rotate the image and tile it through out entire image also.
Please anyone, could you please upload with examples?
...
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...