By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

PHP Ques: Image Retrieval

P: n/a
Hi, I am pretty new to PHP

I want to do the following but I have been unable to find good info/ or
sample code on it; please help;

- retrieve a gif/jpeg image using PHP from another site

- using PHP code I want to edit the image by superimposing a smaller image
on the lower right hand corner

- then display the image to the user

- if possible, store the image to a database (MySQL/ MSSQL) server

Thank you in advance. and please be as detail as you like.

Joe.
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"news" <j@j.cm> wrote in message news:WGjGd.8951$Vn2.3360@trndny06...
Hi, I am pretty new to PHP

I want to do the following but I have been unable to find good info/ or
sample code on it; please help;

- retrieve a gif/jpeg image using PHP from another site
copy($url, $dest_path);

The GD functions can accept a URL in place of a filepath as well. To open an
image locating on a remote server you would do

imagecreatefromjpeg("http://www.cnn.com/harry_swastika.jpg");
- using PHP code I want to edit the image by superimposing a smaller image
on the lower right hand corner
See http://www.php.net/manual/en/ref.image.php. The functions to note are
imagecopy() and imagecopymerge().
- then display the image to the user
imagejpeg($img), imagegif($img), etc. Makes more sense to save to disk
first, however.
- if possible, store the image to a database (MySQL/ MSSQL) server


With MySQL I think you can just dump the binary data into an INSERT
statement. With MSSQL, you need to convert the data to hex decimal first.
Jul 17 '05 #2

P: n/a
Shouldn't there be a free sample project on this already. I mean what I am
asking is pretty simple and probably used very often.....

thanks

"Chung Leong" <ch***********@hotmail.com> wrote in message
news:-r********************@comcast.com...

"news" <j@j.cm> wrote in message news:WGjGd.8951$Vn2.3360@trndny06...
Hi, I am pretty new to PHP

I want to do the following but I have been unable to find good info/ or
sample code on it; please help;

- retrieve a gif/jpeg image using PHP from another site
copy($url, $dest_path);

The GD functions can accept a URL in place of a filepath as well. To open

an image locating on a remote server you would do

imagecreatefromjpeg("http://www.cnn.com/harry_swastika.jpg");
- using PHP code I want to edit the image by superimposing a smaller image on the lower right hand corner


See http://www.php.net/manual/en/ref.image.php. The functions to note are
imagecopy() and imagecopymerge().
- then display the image to the user


imagejpeg($img), imagegif($img), etc. Makes more sense to save to disk
first, however.
- if possible, store the image to a database (MySQL/ MSSQL) server


With MySQL I think you can just dump the binary data into an INSERT
statement. With MSSQL, you need to convert the data to hex decimal first.


Jul 17 '05 #3

P: n/a
news wrote:
Shouldn't there be a free sample project on this already. I mean what I am
asking is pretty simple and probably used very often.....


No, it isn't. Chung Leong posted all the important functions you need.

I wouldn't store the data in a MySQL/MSSQL database. There is a database
designed for files like this. It is ... the filesystem! Use the database
and store a reference to the file.

Regards,
Matthias
Jul 17 '05 #4

P: n/a
"news" <j@j.cm> wrote in news:WGjGd.8951$Vn2.3360@trndny06:
Hi, I am pretty new to PHP

I want to do the following but I have been unable to find good info/
or sample code on it; please help;

- retrieve a gif/jpeg image using PHP from another site

- using PHP code I want to edit the image by superimposing a smaller
image on the lower right hand corner

- then display the image to the user

- if possible, store the image to a database (MySQL/ MSSQL) server

Thank you in advance. and please be as detail as you like.

Joe.


Let me get this straight, you want help on

a) taking an image from another site
b) putting your own logo onto the image, to imply that the copyright is in
fact held by yourself
c) saving and storing that stolen file as your own property

Do I have all the steps correct?
Jul 17 '05 #5

P: n/a
(email-only Followup-To: header not honored)

On 16 Jan 2005, you wrote in alt.comp.lang.php:
"news" <j@j.cm> wrote in news:WGjGd.8951$Vn2.3360@trndny06:
Hi, I am pretty new to PHP

I want to do the following but I have been unable to find good info/
or sample code on it; please help;

- retrieve a gif/jpeg image using PHP from another site

- using PHP code I want to edit the image by superimposing a smaller
image on the lower right hand corner

- then display the image to the user

- if possible, store the image to a database (MySQL/ MSSQL) server

Thank you in advance. and please be as detail as you like.

Joe.


Let me get this straight, you want help on

a) taking an image from another site
b) putting your own logo onto the image, to imply that the copyright is
in fact held by yourself
c) saving and storing that stolen file as your own property

Do I have all the steps correct?


You skipped one. "news" also wants to repurpose data from other websites as
shown in his/her/its thread titled "PHP ques: Webpage retrieval and
parsing" posted the same day.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.