Identifying Black Images
I would like to be able to identify completely black images in order that I can exclude them. I am thinking I could use gdlib but I cannot find a suitable function. If I can find the rgb of the image then I can exclude it.
View Complete Forum Thread with Replies
Related Forum Messages:
Uploading Big Images Turn To Black!
First of all i've VDS Server so i can change any settings in PHP or Apache so all comments are welcomed... I am running a web site where users can upload images and its been online for 4 months and going well, but suddenly i discoverd that when uploading a picture that is about 1 MB 800x530 pixels or other which is 464 KB 1600x1200 pixels, then my script cant read their height and width then i get invalid dimensions and the image dont get resized at all and stays at their original width & height which breaks the page design! and this is when i was using: imagesx(); imagesy(); but i got the dimensions using "getimagesize()" and it was resized correctly but both images turned black! So where could be the fail! Please help me urgently because i think am losing users, i dono how come i didnt test big images b4 going live :( Here is the part where the fail & warnings come! if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { $info = getimagesize($uploadfile); $width = $info[0]; $height = $info[1]; $type = $info[2]; $attr = $info[3]; $image = "$uploadfile"; $newimage = "$uploadfile"; $image_quality = 75; $addborder = 0; $max_height = 480; $max_width = 640; // Main code switch( $info['mime'] ){ case 'image/jpeg': $src_img = @imagecreatefromjpeg($image); break; case 'image/gif' : $src_img = @imagecreatefromgif($image); } $orig_x = $width; $orig_y = @imagesy($src_img); if($width > 640 ¦¦ $height > 480) { $new_y = $max_height; $new_x = $orig_x/($orig_y/$max_height); if ($new_x > $max_width) { $new_x = $max_width; $new_y = $orig_y/($orig_x/$max_width); } $dst_img = @imagecreatetruecolor($new_x,$new_y); @imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_x, $new_y, $orig_x, $orig_y); } else { $dst_img = @imagecreatetruecolor($width,$height); @imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $width, $height, $orig_x, $orig_y); } @imagejpeg($dst_img, $newimage, $image_quality); @imagedestroy($src_img); @imagedestroy($dst_img); $_SESSION["img"] = "$uploadfile"; $formVars["userfile"] = "$uploadfile"; $img = "$uploadfile"; if($width > 640 ¦¦ $height > 480) { $_SESSION["x"]="$new_x"; $_SESSION["y"]="$new_y"; } else { $_SESSION["x"]="$width"; $_SESSION["y"]="$height"; } }
View Replies !
Why Are My Images Coming Out As Black Jpegs?
I've written a script to create thumbnails of my images. Here is my code: list($width, $height) = getimagesize($filename); $new_height = 100; $new_width = ($new_height / $height) * $width; $image_p = imagecreate($new_width, $new_height); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagejpeg($image_p "images/thumbs/1.jpg", 100); When I look at images/thumbs/1.jpg it's just a blank image. Anyone have any ideas why this would happen and how I can fix it?
View Replies !
Black Background On Rotated Images....
I need to rotate an image 5 degrees in PHP for a site I'm working on. The image rotates fine using the imagerotate() function, the problem is the background where it was before turns to black. Any ideas how to fix this?
View Replies !
Creating Black Images When Trying To Create Thumbnails
I am trying to create thumbnails. However, I am only creating black image with the correct thumbnail size. I am using php 5.1.6 and GD 2.0.28. Below is the code that I am using. function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidth) { $srcImg = imagecreatefromjpeg("$imageDirectory/$imageName"); $origWidth = imagesx($srcImg); $origHeight = imagesy($srcImg); $thumbHeight =200; $thumbWidth =100; if($origWidth $origHeight && $thumbHeight < $origHeight){ $thumbHeight = $origHeight / ($origWidth / $thumbWidth); } else if ($origWidth < $origHeight && $thumbWidth < $origWidth) { $thumbWidth = $origWidth / ($origHeight / $thumbHeight); } else { $thumbWidth = $origWidth; $thumbHeight = $origHeight; } $thumbImg = imagecreatetruecolor($thumbWidth, $thumbHeight); imagecopyresampled($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, origWidth, $origHeight); imagejpeg($thumbImg, "$thumbDirectory/$imageName"); } if(!file_exists("/home/alanna/public_html/pics/thumb/")){ if(!mkdir("/home/alanna/public_html/pics/thumb/")){ echo "error making thumbs directory"; } } if(file_exists("/home/alanna/public_html/pics/thumb/". $imagename)){ echo "File already exists"; } else { createThumbnail("/home/alanna/public_html/pics/full/", $imagename, "/ home/alanna/public_html/pics/thumb/", 100); }
View Replies !
Imagecreate :: Resized Images Appear As Black Squares
I dont know why this is happeneing, but all my resized images are being saved as just black squares. It uploads an image of the correct size, to the correct directory. problem is its just a vlack square that it creates. i cant get it to actually put the origional into it. From looking at the code i cant honestly understand why this doesnt work Code: <?php $image = imagecreatefromjpeg("../../member_pics/full_size/".$new_filename); if ($image === false) { die ('Unable to open image'); } $width = imagesx($image); $height = imagesy($image); // New width and height $new_hieght = "100px"; $new_width = "100px"; .........
View Replies !
Identifying Browser
Is there a way to identify the brwser a visitor to my site is using? I would like to include site style based on the visitor's browser. If their us IE show layout one way, if their using Firefox show it another way...etc...etc.
View Replies !
Identifying People
on my website i'm finding people are coming back and signing up again and again... how can i log them so i know who has logged in before. was thinking IP but does this not change per session online with dial up?
View Replies !
Identifying A Value Range
i have a form that submits to a php file, the form basically has a hidden field called number: <input type="hidden" name="number" value="12"> i know how to read the value of that, its simply putting <?php echo $_POST['number']?> but what i want to do is check if the number is between 1 and 25 and if it is then echo A else if it is between 25-75 then echo B else if it is anything above 75 then echo C .
View Replies !
Identifying SSL Clients
I have a site that uses PHP sessions through SSL, my employer does not wish the site to require cookies so I have switched on the use_trans_sid option for users who have cookies disabled. The problem I have is stopping session hijacking. If I am on a page "https://secure.mysite.com/page.php?PHPSESSID=XXXXX" And I email the url to someone else they can get onto the site without being challenged for a logon. I am trying to find a way to check that the connection is still coming from the same SSL connection, e.g. by checking the clients public key, but I can't find a way to get any information about the SSL connection from PHP.
View Replies !
Identifying An Image
Ive got a tracking system which tracks how many times a user clicks on an advert on my site. At the moment all the listings are set as one so when a user clicks on that advert it gets one click. However, one of the adverts is now going to contain two images advertising two separate companies. Ive set it up so the images and urls are different and they go to their own websites and in my tracking table i have just added an extra column called image and the number 1 goes in if image 1 is clicked on or 2 if image 2 is clicked on. However, to display this is the bit im not sure about. At the moment its displayed in a table like this: Advert Name Category Number of clicks Advert 1 Shopping 257 However, if advert 1 has two images, meaning two separate companies, how can I show this in the above table?
View Replies !
Identifying The Clicked Record
i already know how to load the my list of suppliers using mysql/php/apache, but what i would like to do now is put a link for each and every supplier and when someone clicks it, they will automatically go to that supplier's list of products. i want something like this: SUPPLIERS TABLE supplierID, Name, Address, AA Alfin21 1506 w. 66th street <>EDIT<>
View Replies !
Identifying Search Engines
my website is pretty much database driven and i've typically parsed the data in PHP and just output flat HTML. however, i'm trying to save some badwidth by spitting out just the critical information, and have javascript parse out the data. however, i'm kinda worried how search engines would react to this. (especially google) would search engines ignore the keywords if they are inside javascript tags? how do i detect search engines? maybe i can just setup a special script that output's "search-engine-friendly" output.
View Replies !
Identifying Individual Users
I know that you can identify users using an ip address. But what if you have several users with different computers in one room sharing the same ip address. Is there anyway to differentiate each individual. Is there a unique signature from the computers that can be used?
View Replies !
Identifying Parts Of A String
$url = /blah/elephant/spaghetti/page.php This gives you the whole path. But how can you identify each directory in the url individually? ie. I want $one to equal 'blah', $two to equal 'elephant' etc.
View Replies !
Identifying Off-site Links
Is there an easy way to identify off-site links using php? For example, on a forum site like phpbuilder.com, I'm looking for code to flag posts that contain: Code:
View Replies !
Identifying A Page Via Hyperlink
I have a page (product_wide.php) that displays sale items. In that page, I "include" a 2nd page that contains hyperlinks to general item categories. The hyperlinks in filternavbar point to product_wide, and display items from the category selected. I need a way, using the same hyperlinks I am using now in filternavbar, to tell, from product_wide, that it was from filternavbar that the link was clicked (as opposed to some other page in the site that takes you to product_wide. I can't change the configuration of the filternavbar url because of duplicate content issues with google.
View Replies !
Identifying Dynamic Form Fields
User goes to page which is a form that asks for some basic info regarding returning products for credit/exchange, and also asks for how many products are going to be returned. Upon submitting, a return authorization form is presented to them with the specified number of product fields. I now want to take the input from this form and email it to myself, as well as, display a confirmation page to the user. The problem I have is a can't say, for instance, echo "$field_name"; because field_name will get created dynamically after the user specifies how many products to return. For example, say the user says 5 products, this will generate a form with field names like: return_code0 inv_num0 qty0 product0 cre_exch0 stockout0 return_code1 inv_num1 qty1 product1 cre_exch1 stockout1 return_code2 inv_num2 qty2 product2 cre_exch2 stockout2 and so on.... These get created with a for() loop. Once this form is submitted, how can I address the field names? Code:
View Replies !
Identifying Non-Supported Characters In A TTF File With GD?
I've managed to get GD working (mostly anyway) on my site - and am utilising the "imagettftext" function. I am using this function to display individual characters on my website - with a nominated Font. However, sometimes the characters in my StringText are not supported by the particular font that I am using ... Directly from http://www.php.net/manual/en/function.imagettftext.php imagettftext - "If a character is used in the string which is not supported by the font, a hollow rectangle will replace the character." Can anyone suggest some code that would: 1) compare/look at the StringText supplied within the "imagettftext" function (in my case the StringText will comprise of a single character only) 2) where the supplied StringText (ie character) is NOT supported by the font, then I need for that character to be reported as not supported. ie. either; return a flag or skip the non-supported character entirely - rather than displaying the standard "hollow rectangle".
View Replies !
My Thumbnails Are Black
The code below is mean to create thumbs for all images in a folder however they just come out black. Is there an arror or is it a gd function that isnt supported with gd 2.0.28 Code:
View Replies !
Black Border
I'm trying to draw a black border around all my pictures. I get a border as the result but. The borders are all kinds of colors, different grays, white and black. It seems like random. I want black and only black. PHP Code: // Create border around image $black = imagecolorallocate($image,0,0,0); imageline($newimg, 0, 0, 0, $new_height, $black); imageline($newimg, 0, 0, $new_width, 0, $black); imageline($newimg, $new_width-1, 0, $new_width-1, $new_height-1, $black); imageline($newimg, 0, $new_height-1, $new_width-1, $new_height-1, $black);
View Replies !
Identifying Opening Link For Database Query?
I've got a tricky problem i need to solve, i'm building a banner exchange type site in which there are already about 100 banners so i've had to code things around what already exists to a certain extent. Now each of the banners that go out on other sites have a link on the banner which pops open a window with details of the banner. this would be fine if all my banners were gifs and jpgs but there are also swf and dcr banners so i have no real control over the actual link on the banner. up until now each banner had a html page made for it so when you clicked on a banner it would open a page banner_1.html which had the details of that banner. for obvious reasons i'm going to replace all these redundant pages and put a htaccess redirect at their url to all redirect to a common page popup.php so all details will be dealt with in one file. ok this is fine but my problem is in this page popup.php i need to identify the link that just opened the window so that i can then get the info from the database to put on the page.. remember i can't use the url like so... bannerpage.php?thisbanner=1 but all existing links have unique addresses, is there a way to do this, i'm pretty sure there must be but i can't get my head around it?
View Replies !
Identifying Auto Increment Values For Each Of The Fields
I have set up a database i mysql, identifying auto increment values for each of the fields (eg AdminID). I was wondering how i can set up a form which will, when i go to add a new member, have the autoincrement value already present in the field and i can continue to input the rest of my data as usual.
View Replies !
Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and extract rows which match the user's search entry. Data from the matching rows are loaded into an HTML selection list, and the user can scan the list and highlight a selected item. My question: In PHP, what is the syntax for identifying which row is highlighted? My goal is to pass the unique row ID of the selected item to a subsequent form where all the fields will be displayed for the user to edit. I already have the code that loads the selection list and the code that displays the fields. I just need to know how to determine the highlighted item. I have two PHP books, and both discuss loading the selection list, but there is no mention of what to do next.
View Replies !
Form, Type=file And Identifying By Isset()
Windows XP PHP 4.4.2 Apache 2.2 Register_Globals = Off Safe_Mode = On ----------------------- Hi All, I am having a problem getting a file browse input field to be recognized on the next page. Let me show you... page1.php Contains a web form with a file input to attach a file using a browse button. <form method='POST' action='page2.php' enctype='multipart/form-data'> <input name='uploadFile1' type='file' id=uploadFile1'> page2.php contains a validator to check the input and perform an action based on whether or not the browse input field has been populated. // IF THE POST CONTAINS A FILE UPLOAD, PROCESS SECTION 1 IF NOT PROCESS SECTION 2. if (isset($_POST['uploadFile1'])) { echo "File is attached so print this."; } if (!isset($_POST['uploadFile1'])) { echo "File is NOT attached so print this."; } If the user uses the browse button on the form page to populate the field with a file path to a file on his pc, then I expect to see the "File is attached message". However, regardless of whether someone does or does not browse a file, the message is always that they have NOT browsed a file and the variable "uploadFile1" is effectively left unpopulated. OUTPUT File is NOT attached so print this. Conversley, I thought I might be able to use the _FILES variable instead of _POST, but I get the exact opposite, that the browse field is populated all the time whether or not someone has browsed a file or left the browse field blank. if (isset($_FILES['uploadFile1'])) { echo "File is attached so print this."; } if (!isset($_FILES['uploadFile1'])) { OUTPUT File is attached so print this. So, I am missing something. Can someone give me some direction so that I can simply identify (with register_globals = Off) whether or not an input field (input type=file) has been populated or left blank? Is this even possible? What am I missing?
View Replies !
Black Hat Or Not? Linking Technique Using PHP
I had an idea that I wanted to see what people think of it. I'm optimizing a site that is already built w/ very generic file naming and directory structure. In other words, I don't have directories or file names that intentionally have keywords in them. For the most part, its just a lot of index.php and one-word names. So now I'm trying to figure out a way to get some keyword URL's in there w/o trashing my directory structure. Here's what I'm thinking: Let's say I have a link already in the page that goes to index.php. What if I changed the link to keyword_term.php, then I put the following code in keyword_term.php: <?php $no_spider = "TRUE"; include "index.php"; ?> index.php would then have this in the header: <?php if ($no_spider = "TRUE") { echo "<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">"; } ?> I know it seems like more work than its worth, but the idea is that in the long run, I can optimize multiple pages for different keywords, while requiring little maintanence if I decide to edit the original index.php. I'm also using the $no_spider variable to aviod being penalized for duplicate content. My intention is not to get index.php indexed multiple times, just to allow other pages to link to it using different file names.
View Replies !
Black Line Over Frame
I'm having trouble with the frame i am creating.... for some reason there is a black space over the frame, sort of like a line. Here is the frame script: <frameset id="fMain" rows="530px,*" border="0"> <frame src="Main.php" name="Main" scrolling="no" style="border-rorder="0"> <frameset id="fBottom" <frame src="Bottom.php" name="Bottom" scrolling="no" /> </frameset> </frameset>
View Replies !
Uploaded Image Has Black Bar
I was wondering if anyone has ever encountered a problem with an uploaded and resized image that now has a black bar on the right side of the image? The image is uploaded and resized properly via a form, however the right 10% of the image is black.
View Replies !
Retaining Black Color
What I'm doing is changing the color of one image and then overlaying it on top of another with an opacity of around 35%. The bottom image contains pure black text. What I want to know is if there is a way to merge the two images while retaining the color of the black text underneath. A lot like using a multiply layer in Photoshop. I'm not even sure if this is possible, or if I'd be simply better off just having a separate layer/image just for my black text.
View Replies !
Strange Black Lines
I've got an image resizing tool that I've adapted from one I've used before (which worked) and I'm having a few issues with it. The thumbnails generated are either squashed but look normalish OR the right size but with the black background from the imagecreatetruecolor function used. My code is: PHP Code: $im = @imagecreatefromjpeg($image); // Changes the image from a file path to an image resource. $type = @getimagesize($image); // Sets the image type. //$height = $type[0]; //$width = $type[1]; $height = imagesy($im); $width = imagesx($im); $imgw = 150; // Sets the width of the thumbnail $imgh = ($height / $width) * $imgw; //$imgh = round(($height / $width) * $imgw); $thumb = @imagecreatetruecolor($imgw,$imgh); // Creates blank thumbnail @imagecopyresampled($thumb, $im, 0, 0, 0, 0, $imgw, $imgh, $height, $width); // Copies main image into thumbnail. // Displays the resized image......................
View Replies !
Cropping Black Section
I am doing this sequence: $image_rsz = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($UploadName); imagecopyresampled($image_rsz, $image, 0,0,0,0, $final_width, $final_height, $width_orig,$height_orig); and uploading the resized image. The resizing looks right, but the JPEG file has a black section appended to the right of the image that is the same height as the resized image, but about 2 1/2 times the width of the picture. Is there something that needs to be done to crop off this excess? The original image, prior to resizing, did not have this.
View Replies !
Voting System - Identifying Voter And Integrity Of The Vote
I am trying to setup a voting system for our intranet (staff awards - free text fields). I have the database adding the votes no problem. What I would like to do however is the following: 1. It's our intranet, there is no need for each person to login so it just uses "user/user". However I need to capture the person's login on the vote record so I can identify who voted. 2. restrict the users to one vote each. I have done some research and it looks like I have to create a cookie.
View Replies !
Identifying Different Unicode/utf-8 Types Inside A Text String
I am dealing with a script that reverses a string that is in hebrew, so I can display it properly when I write that string onto an image, however sometimes the string might be half hebrew half english, so I need a way to identify what language is in the string and only reverse the hebrew parts. in technical terms the hebrew text is encoded in utf-8, and the english text will be encoded in the normal encoding for english, (anscii, latin-swedish whatever, i dont know the name of that encoding) so the simple question is how do I identify different types of encoding within a string? that way I can break up the parts that i identify as being utf-8 and reverse only those (yes I am well aware of methods to display hebrew properly in php, but when writing to an image this is another story, only method i found so far is reversing the hebew text string)
View Replies !
Recode From Color To Black And White
try to recode my php code below from generating just a black and white image. the code below takes time to process cause its trying to generate as much colors as it could receive from its source, but the thing is, the source is just passing black and white colors.. Code:
View Replies !
GD Imagecopy Problems With Black Background
This function is part of a class, it basically creates a new image in the dimensions specified, and then copies in the image held in $this->image. The image that is copied in will never be bigger than the new image (that is taken care of in another function) but one or both of the dimensions could be less than the new image (if the ratio isn’t the same). It all works perfectly, it creates a new true colour image, fills it in white, but then when it runs the imagecopy function it seems to forget the fact that I set the background to white, and the image that results has a black border. For example if I wanted a 100x100 image, and I was copying a 100x50 image in, I would end up with a 100x100 image with the old image centred vertically and a 25px black stripe above and below, I want those stripes to be white. Any ideas? function crop($width = null, $height = null) { // get the current widths and heights $current_width= imagesx($this->image); $current_height= imagesy($this->image); $crop_top = floor(($current_width - $width) / 2); $crop_left = floor(($current_height - $height) / 2); // create a new image resource $temp= imagecreatetruecolor($width, $height); $white= imagecolorallocate($temp, 255, 255, 255); imagefill($temp, 0, 0, $white); // copy image into new resource imagecopy($temp, $this->image, 0, 0, $crop_top, $crop_left, $width, $height); // destroy original image imagedestroy($this->image); // copy new image $this->image = $temp; }
View Replies !
Imagecreate Output A Solid Black Image
I'm making thumbnails. I want to first scale down the image before I crop it even smaller. The code below only creates a solid black square. Actually, only $final_im creates an image that's solid black. If I used $im as the output file (if I use this instead: imagejpeg($im, "$new_name") ), it's fine (albeit a very low quality image that does not have the dimensions I desire). I figure the problem lies at the //create final thumbnail section of the code. But, again, everything looks right. I would try other functions like imagecopyresizedbicubic , or imagecopyresampled but my server is using an older GD version, and I cannot upgrade it (ISP's server). PHP Code:
View Replies !
Error In Converting GIF Image To Black & White
I have a doubt in php.I wrote a php program to convert colour Images to balck & white.It is working fine with JPEG files and PNG files.When it comes to GIF files I am not getting the colour Image.I think I found the reason of getting error.But I am not able to solve it I am pasting the code which I wrote The reason I think is when I am extracting the RGB value from the image,R and G will be zero everytime.But I am getting the value of B. As a Result I am getting a Black Box instead of Black and white Image $file = 'logo2.gif' header('Content-type: image/gif'); $imgtype = "gif"; list($width, $height) = getimagesize($file); $source = imagecreatefromgif($file); $bwimage= imagecreate($width, $height); for ($c=0;$c<256;$c++) { $palette[$c] = imagecolorallocate($bwimage,$c,$c,$c); } function yiq($r,$g,$b) { return (($r*0.299)+($g*0.587)+($b*0.114)); } for ($y=0;$y<$height;$y++) { for ($x=0;$x<$width;$x++) { $rgb = imagecolorat($source,$x,$y); $r = ($rgb >16) & 0xFF;//error is here I am getting a value of zero for $r and $g $g = ($rgb >8) & 0xFF;//error getting the value zero everytime $b = $rgb & 0xFF;//Here I am getting value $gs = yiq($r,$g,$b); imagesetpixel($bwimage,$x,$y,$palette[$gs]); } } imagegif($bwimage);
View Replies !
Imagerotate(), Producing A Black Background Color
I am having this Image, the background of the image is transparent But on rotation using imagerotate(), it is producing a black background color. This background color is coming on using any function on the original image ie, like imagecopy() etc . I have used imagecolortransparent() to suppress the color, but still the problem is coming.
View Replies !
Createimagefromjpeg With URL's Produces Black Image
i only see a black image when i use createimagefromjpeg with URL. i even used a native url and it is still the same. when i use direct path, i can see the image though. what could the possible cause be? this is run on linux server and allow_url_fopen is turned on.
View Replies !
ImageCopyResampled - How To Avoid Default Black Background?
I would like to know how to avoid the default black background color in ImageCopyResampled if origin and destination do not fit. ImageCopyResampled puts always a black background and if I try to fill it with another color and with ImageFill function, ... I get problems: Some images with a deep dark colors predominance or even with a deep light color predominance too, are filled with my color, as you know, applied with ImageFill. Code:
View Replies !
Problem W/ Imagecreate() To Pdf ->image Printing Black Fuzz
this may be an issue with printer or something but i was wondering if anyone had seen this before?? info.... -the application is a work order request form that generates a pdf of form w/ user's input filled in. -a unique "request number" is created and is put in the pdf via imagecreate() - black text on a white background. for some people, the image/request number displays fine but when printed, is a black fuzzy block (see image below) taken from scan of printed form: http://www.alumni.uga.edu/it/beta/request_num_pdf.gif
View Replies !
Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure. Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them. An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture. Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.
View Replies !
PHP (GD) Created Transparent PNG: AlphaImageLoader Makes Black Parts Transparent Instead Of Transparent Color Set With PHP
I have a problem with PHP (GD) created transparent PNG and Microsofts AlphaImageLoader. You will immediately see what the problem is if you view http://www.useful-scripts.biz/test/.../transpng_2.php with IE 7 or Firefox and then with IE 6. It seems that the AlphaImageLoader works correctly on a PNG image that has been created with an image processor and then uploaded, but not with a PNG image created with PHP. It seems to ignore the transparent color set with PHP and instead to render the black color transparent. The image in question was created using this code: <?php $source = imagecreatefrompng("parrot_orig.png"); $transp = imagecolorallocate($source,255,0,0); imagecolortransparent($source,$transp); imagefilledrectangle($source,15,15,70,70,$transp); imagepng($source,"parrot_php.png"); ?> The HTML used on the page is this:
View Replies !
Random Images From Google Images
I am trying to set up a page that will show a random image of something on a web page (e.g. cats) taken from a random Google Image. I can't find any sample code to do this. Can someone point me to an example?
View Replies !
Portrait Images To Landscape Images
I am putting together an image gallery using open source code. I have a script to generate thumbnails but it is not ideal because the quality loss from the original images is high. Secondly, ideally i would like the portrait images to resize to the same size as landscape images but i am not sure how to achieve this.
View Replies !
|