You are here: Binary Content from Image Resource « PHP Programming Language « IT news, forums, messages
Binary Content from Image Resource

Posted by Areric on 04/16/06 20:13

Ok all im probably missing something really simple here but i cant find
a function in the gd lib function list that would let me do this. Im
probably just slow today.

Im doing a scaling script which im pretty sure is working great except
one of my goals is to never have to write this stuff to a temporary
file. I store all of my images in the db so when i make this new scaled
image, id like to just add it as a new image to the db.

right now im doing a bunch of stuff and then these 2 lines

$scaledImage = imagecreatetruecolor($targetWidth,$targetHeight);
imagecopyresampled($scaledImage, $originalImage, 0, 0, 0, 0,
$targetWidth, $targetHeight, $originalWidth, $originalHeight);

That leaves me with $scaledImage as a php image resource containing
what i need. My question is this:

How do i get the binary data out of $scaledImage so that i can then
write that to the db. I already have scripts written to add binary data
to a database, its the actually pulling that information out of
$scaledImage that i cant figure out.

Any idea?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация