473,503 Members | 9,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP Ques: Image Retrieval

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
5 2596

"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
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
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
"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
(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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3330
by: Pierre Tremblay | last post by:
Hi! I am trying to display an image in my html document. The document contains the following line: <td class="Input"><img...
2
3479
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button...
2
1300
by: news.microsoft.com | last post by:
Hi, I am pretty new to ASP.net 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 ASP.net from another...
4
2682
by: Jake | last post by:
Does cookieless session state (with the sessionid embedded into the url) interfere with the browser's retrieval of cached images from one session to the next? Does the sessionid embedded into the...
7
2275
by: BluDog | last post by:
Hi I am trying to store an image in an xml file, i vcan store it fine but the retreval is a bit of a problem: To String: Dim ms As New IO.MemoryStream Dim arrImage() As Byte...
2
1941
by: addicted2rpg | last post by:
For background on this problem, see: http://support.microsoft.com/kb/q249232/ I essentially get a IHTMLWindow2 object, IHTMLDocument2 object, etc.. from an HWND of an internet explorer process. ...
3
5224
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
6
6395
by: Daniel Fetchinson | last post by:
Hi all, There are a number of free tools for image matching but it's not very easy to decipher the actual algorithm from the code that includes db management, GUI, etc, etc. I have my own image...
21
1541
by: DP | last post by:
Hi, I'm not sure if this is the right group to ask. I am developing a small image library and I don't know how to hide the actual path to the image. So I go to the stock photo library websites...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.