GIF Resize Resample Transparent Fill
I am currently trying to create what I would think is simple. I want to create a image.php file and have it resize a 80 x 80 image to 29 x 29 with out losing the quality. When I try to have the gif image imagefill with the color white (255,255,255) it holds up and ends with a timeout. The gif images also have the black pixels if i don't try filling.
Does anyone know a simple script to just resize a gif/jpg file? All documentation has been pretty bad so this is first time posting.
View Complete Forum Thread with Replies
Related Forum Messages:
Resize Transparent PNG
I have a basic script to resize a transparent png image. Code: $dimg = imagecreatetruecolor($newwidth, $newheight); imagecolortransparent($dimg, imagecolorallocate($dimg,0,0,0)); imagealphablending($dimg, false); imagecopyresampled($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight); Problem is that my nice drop shadows are lost in resize. Does anyone know how I can keep them ?
View Replies !
Create Or Resize Transparent .png - Drop Shadow - GD IM
I've searched and d/l'd but cant seem to find a way of creating a semi-transparent drop shadow for an image. Let me say, be fore I go on, I *do not* want one of those scripts that resizes your image a bit to the left and bottom, and then grafts a shadow onto it. I want to use a full shadow (it would be about as big as the image) and shift it a bit with CSS. So, I will have the image sitting in a DIV which will have the shadow as a bg. This works fine doing it manually. So, I would like to find one of two alternatives: 1. (best) Create the shadow from given parameters(size, darkness, spread, etc.) I will write the .png to a folder, I dont really need to create it dynamically each time, but want the ability for the future (galleries) and for when I'm in development and images are changing, moving around, etc. 2. (will work) Take a pre-existing shadow and resize it as needed, but has to keep the transparency.
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 !
GD Resample
User is uploading an image of any reasonable size. GD resamples it to a max 600 width and a max 250 height, however, the new image is 50k - which is too big. It was originally 300DPI, but I don't know if that resample affects that or not. I don't want to lose a "decent" quality of the image, but I want to make sure it's not more than 72 DPI and no more than about 10, regardless the original size. How can I do this? Here's the code I'm using: PHP Code: $image_rsz = imagecreatetruecolor($target_wd, $target_ht); $image = imagecreatefromjpeg($UploadName); imagecopyresampled($image_rsz, $image, 0, 0, 0, 0, $target_wd, $target_ht, $orig_wd, $orig_ht); imagejpeg($image_rsz, $UploadName);
View Replies !
Resample GIF On Mac
I've tried every way to resample a GIF and it just won't work on mac. PHP Code: $source_id_original = imageCreateFromGIF($destination) or imagegif($destination) or imagecreatefromgif($destination); Since it works on my PC i know the permissions are fine and evreything. The $destination variable also has the correct value when echo'ed to an image that does exist.
View Replies !
Image Manipulation - Resample
I have an image upload facility that resizes/resamples the image using the following code: $im=ImageCreateFromJPEG($target_path); $width=ImageSx($im); // Original picture width is stored $height=ImageSy($im); // Original picture height is stored $n_width= 251; // Fix the width of the thumb nail images $n_height= $height * ($n_width/$width); $newimage=imagecreatetruecolor($n_width,$n_height); imagecopyresampled($newimage,$im,0,0,0,0,$n_width,$n_height,$width,$height); Although this works in so far as the image rezises and doesnt lose alot of quality, depending on the image uploaded it either doesnt fill the div tag i need it in or is too big for it. Does anyone know how to code could be modified to ensure that all uploaded images fit the div tag without loss of quality. I thought about setting the width and height manually within the code e.g. $n_width = 251; $n_height = 188; but i thought this might cause loss of quality. The dimensions for the div tag are: Width - 251 and Height - 188.
View Replies !
Transparent GIF
I am trying to resize transparent GIF images, so I was reading, and they say to use fopen, fread, and read the first 13 bytes... OK, so I read in a transparent gif, and the first 13 bytes... and echo it out to the screen, and I get this: GIF89a›�s�÷��What am I supposed to do with that? they then say "allocate that color as transparent, and use imagecopy(); to set the transparency back."
View Replies !
Transparent .png
This isn't totally related to php, but I am using a php generated page that is using transparent .png's. Anyway, when I view the page in Internet Explorer, the transparency within the png is replaced with grey?? But when I view it in Firefox it works fine?
View Replies !
Transparent Image
Hi! Here's a piece of code: [begin] <?php Header('Content-type: image/png'); $sz = ""; $FileValue = 1000; $i = strlen($FileValue); for ( $j = 0; $j < 7-$i; $j++ ) { $sz = $sz . "0"; } $Img = imagecreate(56,13); $Gold = imagecolorallocate($Img,148,128,100); $Gray = imagecolorallocate($Img,32,32,32); ImageFilledRectangle($Img,0,0,55,12,$Gray); imagestring($Img,4,0,0,$sz.$FileValue,$Gold); imagepng($Img); ImageDestroy($Img); ?> [end] OK. Calling this script I have a png picture back. Now I add imagecolortransparent($Img,$Gray); just before imagepng() and OK again, I have a transparent picture back. But now, if I add: $r = imagerotate($Img,90,0); imagepng($r); just after the imagecolortransparent() instruction seen above, I get a rotated picture, but not transparent. How to solve that? I've used a plenty of tricks, no one works.
View Replies !
Transparent GD Watermark.
Any one know what would be the best way to accomplish a transparent watermark on upload with GD that will work for Jpegs, Gifs and Pngs, using only GD in php 4?
View Replies !
Transparent Background
i'll try to explain myself the best i can, here is the problem: i have a html page and inside this i want to put an iframe that contains a php page. That's ok, i can do it and it works, but the problem is that i can't make that php document to have transparent background. it turns white. Is it because of the iframe? the php document has transparent background, but when i see it inside the iframe it doesn't work.
View Replies !
Two Transparent Colours
I have an image that I am opening and then merging onto another image, and it has two colours which I wish to make transparent, but it is not working, can you please give me an example of how to do this thanks. When I say that it is not working, I mean that when I allocate the second one, the first one is no longer transparent.
View Replies !
Transparent Overlay Watermark - On The Fly?
Is it possible to overlay a transparent watermark on an image - dynamically? I'd like the result to look like this example: <http://www.cycletourist.com/temp/photo.php> That is a bit of overkill, but you can see what I mean. The watermark image (a png image) is included separately below the photo. I tried using a class from phpclasses.org <http://www.phpclasses.org/browse/package/1580.html... but the result looks horrible. The transparency does not work. I found one other method through Google, <http://www.sitepoint.com/article/watermark-images-php> but it did not work, either. Can this kind of transparent overlay be done on the fly with GD lib?
View Replies !
Dynamically Transparent Gif's
Basically what i would like to do is dynamically set the transparency of a selection of images (GIF'S) depending on variables set in a My SQL Database. What i need to do is tint some jpg,s by setting the transparency of a solid blue gif which is set over the top of it in a table.
View Replies !
Imagegettftext Transparent Holes
I created an image, made it transparent, drew a rounded rectangle on it and then wrote on it with imagegettftext - where the text is there are transparent holes. $image = imageCreateTrueColor($width,$height); imageSaveAlpha($image, true); ImageAlphaBlending($image, false); $transparentColor = imagecolorallocatealpha($image, 255-$r, 255-$g, 255-$b, 127); imagefill($image, 0, 0, $transparentColor); $background = imagecolorallocate($image, $br, $bg, $bb); .......
View Replies !
Define The Transparent Color
I've made a script that takes images (in gif,jpg & png) and makes their thumbs in jpg format. Now, the problem is if I have a transparent gif when saved to jpg the part of the original picture that is transparent turns black in the new thumb. My question is: how can I define that the transparent part gets the color i want it to get (white is what i need) ? Actually, I now what in theory should be done. I should change the r,g,b values of the color that has aplha=127 (and that's not a problem with imagecolorset()), but also I should change the alpha of that color to 0. how can that be done ? My quess is that that is the right way to do it.
View Replies !
Transparent Watermarks On Images
I'm using the code below to make a watermark and it's kinda working, but I want it semi-transparent as the PNG file is itself. Is there an easy way of overlaying transparent images in the GD library, so that the original image is merged in such as way that it can be seen through the watermark? Code:
View Replies !
Make Thumbnail Transparent
I have a script that will upload an image, then create a thumbnail of that image. When I upload an image with a transparent background the normal sized image comes out with a transparent background, but the thumbnail image comes out with a black background. Code:
View Replies !
Transparent Text On Image?
Is it possible to place transparent text on an image? I want to display an image of some text in a fancy typeface, but superimpose text in a plain style, so that it can be copied and pasted; a bit like what you see in some PDF files, where the page image is visiable, the overlying text is not.
View Replies !
Transparent Filled Polygon
I'm working on a map program where each building is clickable and when it's clicked the page is refreshed to show a map with the building highlighted (in red). I was wondering if it would be possible to highlight the buildings using some sort of combination of the imagepolygonfill function and a transparency function (i'd like the buildings to still be visible under the highlight), rather than having to create many different files with the different buildings highlighted.
View Replies !
Make A Colour Transparent
I would like to do is grab an image, determine what colour is at a certain pixel (maybe 10, 10) and then set that colour to transparent for the whole image. Basically it is so that I can dynamically place an image on various backgrounds for previewing. I am not worried about perfection (anit-aliasing, matte, etc).
View Replies !
.htaccess Transparent SESHID And Sessions
just putting the finishing touches on a shopping site and have run into errors in the process when users are blocking cookies. i am using: <IfModule mod_php4.c> php_value session.use_trans_sid 0 </IfModule> in my .htacess file to supress the PHPSESSID=22y3213etc. but it means that if a cookie isn't set the site fails to work properly. if i remove that from my .htaccess the site works fine because the PHPSESSID is passed around evey page, but it knackers things for SEO purposes. Code:
View Replies !
How Do I Echo A Binary Array (transparent Pixel)
What am I doing wrong here? I want to display a transparent pixel... <? $transparent1x1 = array (71, 73, 70, 56, 57, 97, 1, 0, 1, 0, -128, 0, 0, 0, 0, 0, 0, 0, 0, 33, -7, 4, 1, 0, 0, 0, 0, 44, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 2, 68, 1, 0, 59); header("Content-type: " . image_type_to_mime_type (IMAGETYPE_GIF)); echo $transparent1x1; ?>
View Replies !
Textarea Fill
I need an idea on how to accomplish this task. I have a script that I tried so many times to tweak but failed; so I am starting afresh. I am working on a project with PHP and MySQL and the table below is one of the tables in the db. title_duty id int not null auto increment title varchar(255) duty text The table are populated with titles and their duties. I need a php form with a dropdown menu of the titles of which when a user selects a title, the corresponding duty of the selected title, will display on a text area in the form; where the user can edit the duty. Now the form output can either be submitted to another table for selection with another form or can be a POST in another form. Any ideas on the best way to solve this nagging problem?
View Replies !
Fdf Fill Out A Form
I followed the instruction of http://fooassociates.com/phpfer/html/rn20.html I know how to fill in the data into a form on the browser of the client. Is it possible to fill out the form on the server and to send this as a pdf file to the client?
View Replies !
How Fill SQL Database..
I've made a database with phpmyadmin. Now I want to add text to the fields i"ve made. Can i do this trough phpmyadmin or how can i do this? I've got these fields. id int(11) No Null auto_increment titel varchar(50) No Null bericht text No Null datum varchar(16) No Null Can I add text to these fields from phpmyadmin? Or do i have to use php to fill it? Could someone please help me make a php page that can fill this database? My aim is not to use this, but to learn how i can do it myself.
View Replies !
Fill In Alt Tags
I have been tying for ages to use php to create alt tags that pull data from a mysql database. So for instance the alt tag could show the region, price and country etc by pulling that info from a table. I have this code below but I get this error: Parse error: syntax error, unexpected T_STRING. This is the code I'm using: PHP Code: if(!empty($a1[image])) { $images = explode("|", $a1['image']); $MyImage = $images[0]; //$ListingTable .= "<img src="re_images/$MyImage" width=100 height=80 border=1>"; $ListingTable .= "<img src="thumbnails/'.$MyImage.'" width="100" height="80" border="1" alt="'.$a1['region'].', '.$a1['country'].'" />' echo $ListingTable; } else {$ListingTable .= "<img src="no_image.gif" border=1>";} Does any know why it still isn't working?
View Replies !
Please Fill Out This Web App Development Survey
I work for a start up company that is working out of a basement to develop a new app framework to assist developers in writing apps that contain complicated business rules. I'm tasked with gathering market data that we can present to potential investors. The survey is targeted at experienced web app developers with both business and technical knowledge. The survey will take about five minutes, and is located here:
View Replies !
Auto Fill Forms?
Is it possible to auto fill form with your information. Example: https://login.yahoo.com/config/mail?.intl=us Can I Log into there with my username and password from a php file and check if the word anoluck exist.
View Replies !
Seach And Fill Textbox
can someone point me in the direction of script that will search a database and will offer a drop down that populates with the search results that can be selected to fill the textbox.
View Replies !
Automatically Fill In A Web Form
As part of a group project I have been assigned to research how PHP can be used with HTML web forms. What I need to know is, is it possible to automatically fill in a web form using a PHP script? i.e. Fill in the text boxes, and such with information passed in to the PHP script.
View Replies !
Php Array Used To Fill In A Web Page
I know how to use php/mysql to fill in a page with information, but I read a little about arrays and i think this may be an interesting and easy way to maintain a small website. My idea is to have all the titles, descriptions, etc in one php document...
View Replies !
Auto Fill Form
I need to fill a form that is on another website that I don't have any control over. Basically there are two fields on that other website. First name and lastname. Is there anyway I can auto fill that from my site? I know We can submit forms on another site using CURL. But I would like to know if i can fill the form fields on another site.
View Replies !
If / Then Statement - Fill Out A Unique Url
This is probably one of my weaker points and any directions or starting off point would be greatly appreciated. Below is the statement i have now to call up a search and basically call up images: <?php $query = mysql_query("SELECT DISTINCT * FROM itltest WHERE city='$city2' AND state='$state2' AND directorytile<>'NULL' ORDER BY company LIMIT 10") or die (mysql_error()); while ($row = mysql_fetch_assoc($query)) { echo('<a href="wpa.php?jobnum=' . $row['jobnum'] . '&custID=' . $row['custID'] . '&wpastate=' . $row['wpastate'] . '&wpacity=' . $row['wpacity'] . '"><img src="' . $row['directorytile'] . '"></a><br><br>'); } ?> What i'd like to do is expand it to if one field in mysql is filled out then the href is that field instead of going to the wpa.php page. Hope that makes sense. In a nutshell there will be the ability to fill out a unique url. IF that specific url is filled out then the image's href needs to go to that url.
View Replies !
Formmail, Containing A Lot Of Forms To Fill In
I have a really annoying problem, and am quite frankly a newbie at everything php related. I need a formmail, containing a lot of forms to fill in. And! I need the actual email to come up as Name: (form) Job: (form) With big and small letters, and I haven't seen any form that is able to do this. I also need it to be kinda simple, since I have no experience at it at all. I've tried almost everything.
View Replies !
Fill In A Form + Get Results
Is it possible to use php to fill in data on another site, and get the results back from the site? i presume if so, i will need to parse html? the remote site I want to use is a .do ( java ) site.
View Replies !
Auto Fill A Form
I seen a website doing this but not in php so Im wondering if it is possible to open up a page like http://mail.yahoo.com and fill in my username and password with a php script? if possible how can i do this?
View Replies !
Efficently Fill Time Box
I am going to build a timesheet system and here is my database table. user_id varchar(30) prj_id unsigned bigint time_date (Format YYYYMMDD) time_amount unsigned double (remark: number of hour spent) How could I get data from database to fill in a specified date box in my timesheet? What is the most efficiency way? user_id, prj_id, time_date, time_amount user1, 0, 20070807, 1 user1, 2, 20070810, 4 user1, 1, 20070808, 2
View Replies !
Form Fill & Print
im trying to create a simple form that visitors will complete name address phone email and quantity, i dont need the form sent anywhere just a confirmation page that the visitor will print and post. its just to place an order for one item i will sell. I see so many PHP forms but they seem way to advanced for my simple needs.
View Replies !
Autmatic Form Field Fill
I have two fields in a form. The first is the email field the second is the username. Now I want the username field to be filled automatically with the part before "@" of the first field. So if someone fills in "brain@domain.com" the second field has to be filled with "brain".
View Replies !
Create And Fill-in Form From MySQL
I am working on an admin page where a user can input data into two text fields. When the the form is actioned the two fields are inserted into a table as a row. What I want to do is when the user calls up the form, any rows that exsist in the table are inserted into the text fields. So the user will see x number of rows with the text fields on the form (x number being number of rows in table). The data is listed in order as determined by the MySQL query. At the end I want to add two blank text fields. The user can then edit the data in the text fields which updates the appropiate row or enters data into the bottom (blank) text fields which adds a new row. This is the query I have to call the data PHP Code:
View Replies !
Fill A Form Authenticated HTTPS
I'm searching all around the web without any good answer, maybe you have the right one. I'm trying to fill&send a form on a site authenticated https via curl. The problem is simply that it doesn't arrives to authenticate.. It returns id error1 -> unsupported protocol. The code is the following: <?php $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $login_url = "https://www.my_site.com/login"; $login_data = "username=my_user_name&password=my_pass"; $form_url = "https://www.my_site.com/form"; $form_data ="input1=walla&input2=test"; $ch = curl_init($login_url); curl_setopt($ch, CURLOPT_SSLVERSION, 3); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); curl_setopt($ch, CURLOPT_COOKIEJAR, "curl_cookies"); curl_setopt($ch, CURLOPT_COOKIEFILE, "curl_cookies"); curl_setopt($ch, CURLOPT_POSTFIELDS, $login_data); $body = curl_exec($ch); // login curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_URL, $form_url); curl_setopt($ch, CURLOPT_POSTFIELDS, $form_data); $body = curl_exec($ch); // get form results echo "error curl_errno ($ch) <br>"; //it return error id1 curl_close($ch); ?>
View Replies !
Fill $_FILES Argument From XML Parser
I've a function asking for a $_FILES argument: function insertarticle($particle,......,$pUserID,$pOptions, $files){ in this function I do add the record and then save the files in a subdirectory specific on some datas. This function is used by my "insert" form, letting the user to select images files to upload with <FILE> html tag. The files to upload are then passed to the $files like this: insertarticle(1884,......,4,$Options,$_FILES); for mantainance purpose, I avoid as much as possible to have the same code in 2 different pages. Also, using actually this function to add a record in the database (quite complex code) and saving files from a form, and using the same function to add records from an XML parser, I can't send images files to the function. My parser can save the images files on the server's directory, but how to pass $files parameters in order to save those files ? It's there any way to take the string containing the base64 image code (I do actually save it locally) and put it in a $_FILES array for passing it to the function ?
View Replies !
How Do I Fill Config.inc.php3 PHPMyAdmin?
I'm trying to install PHPMyAdmin in mysql. I have a f2s account and need to administer my dbs, after I fill it with server, user and pass the config and run localhost/../indexphp3 it try too run (many errors are in my browser): 1- left side displays phps scrips 2- getright bigings to download php.exe 3- other that I didnt remember now.... How do I fill config.inc.php3 PHPMyAdmin correctly? $cfgServers[1]['host'] = '' $cfgServers[1]['port'] = '' $cfgServers[1]['adv_auth'] = false; $cfgServers[1]['stduser'] = '' $cfgServers[1]['stdpass'] = '' $cfgServers[1]['user'] = '' $cfgServers[1]['password'] = '' $cfgServers[1]['only_db'] = '' $cfgServers[1]['verbose'] = '' I'm using Apache, MySql and Php4 and are working ok.
View Replies !
|