FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to create a php files that contain a image ?





Philip
How to create a php files that contain a image ?

like this for resize
image.php?link=http://www.frihost.com/images/frihost2.jpg&sizeheight=50&sizewidth=50&mode=resize

like this for croping image files
image.php?link=http://www.frihost.com/images/frihost2.jpg&sizeheight=50&sizewidth=50&mode=crop

thanks Smile
Maryndor
How to create ... ?!

Well did you checked the PHP manual or you just need code?!
In that type of question (kind of asking) I can answer only that there's interesting functions like imagecopyresampled , imagecopyresized, imagecreatefromjpeg etc.

BTW PHP does not CONTAIN image, it just read the file, mix-fix-blix etc, send to browser/write to file. Very Happy But that was just a kidding Razz
Philip
wew i am not good at php image,
can some want create that i want php code ? Smile
thanks,
hexkid
Philip wrote:
How to create a php files that contain a image ?


Code:
<?php
$data = array(
  0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0f, 0x00,
  0x0f, 0x00, 0xb3, 0x0e, 0x00, 0xff, 0xea, 0x00,
  0x45, 0x45, 0x45, 0x00, 0x00, 0x00, 0xff, 0xce,
  0x00, 0xff, 0xc9, 0x00, 0xff, 0xb4, 0x00, 0xfe,
  0x9d, 0x00, 0xff, 0xfe, 0x93, 0xff, 0xfd, 0x13,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x33, 0x33,
  0x33, 0xff, 0xff, 0xeb, 0xff, 0xe5, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0xf9, 0x04,
  0x01, 0x00, 0x00, 0x0e, 0x00, 0x2c, 0x00, 0x00,
  0x00, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00, 0x04,
  0x5b, 0xd0, 0x49, 0x19, 0x6a, 0x9d, 0xd8, 0x55,
  0xa6, 0xce, 0x19, 0x17, 0x16, 0x70, 0x08, 0x02,
  0x9c, 0x83, 0x11, 0x4c, 0x41, 0x27, 0x08, 0x27,
  0xf0, 0xa6, 0xab, 0x76, 0x98, 0x71, 0x0e, 0x6a,
  0x0a, 0x0e, 0x9f, 0x3f, 0x82, 0x2a, 0x70, 0x03,
  0xc6, 0x82, 0x85, 0xca, 0x21, 0xc7, 0x04, 0x10,
  0x92, 0x01, 0xd3, 0xa2, 0x09, 0x58, 0x3c, 0x2b,
  0x03, 0xd9, 0x6b, 0xbb, 0x15, 0xae, 0x02, 0x59,
  0x41, 0x62, 0x3c, 0x16, 0x10, 0x76, 0x9a, 0xc1,
  0xa0, 0xc1, 0x35, 0xd3, 0x58, 0x6a, 0x82, 0x5c,
  0xfe, 0x16, 0x05, 0x0a, 0xf8, 0xc2, 0x30, 0xc3,
  0xb2, 0xd4, 0x26, 0x11, 0x00, 0x3b, 0x0a
);
header('Content-Type: image/gif');
foreach ($data as $byte) {
  echo chr($byte);
}
?>
Maryndor
hexkid, LOL.. that was my idea for reply, but I thought it would be too offensive Very Happy and didn't want to hurt the people too much , so decided to be as nice as possible LOL Wink

Philip-dude, If I have enough time tommorow (currently 22:35 EST) will code something for ya. Very Happy
Philip
i don;t get it
what is that hexa for ? O.o
please some one explain it for me ...
fritz06
Php has a special library to create and edit grafics:
http://www.phpman.info/php_manual_en/ref.image.html
yjwong
The GD library bundled with PHP has the ability to edit graphics. You can actually use the GD functions to read the image, then apply all sorts of transformations to it.

You can also file_get_contents() an image then use header() to change to content type to image/png or image/gif or image/jpg to send the image to the browser to mask the name of the true image.
Related topics
.htaccess tutorial
Dynamic PHP Images
PHP Tutorials
Need some php/mysql dlls
[*READ THIS FIRST!*] Commonly asked questions
Fix for deleting files/directories owned by apache
Php - Basic Encryption site
Requiring dedicated multitaskers for forum project
Avatars
Display random image on foreign site
Frame Effect Without Frames! (PHP)
Uploading and resizing an image
Need to find text in php files
Encodings of Mysql and PHP files have to be same?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.