473,804 Members | 3,686 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 2611

"news" <j@j.cm> wrote in message news:WGjGd.8951 $Vn2.3360@trndn y06...
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

imagecreatefrom jpeg("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@trndn y06...
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

imagecreatefrom jpeg("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@trndn y06:
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.p hp:
"news" <j@j.cm> wrote in news:WGjGd.8951 $Vn2.3360@trndn y06:
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
3349
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 src=getimage.php?tbl=dbo.Employees&type=jpg&col=Photo&idCol=EmployeeID&id=1 Border=0 alt=''>&nbsp;</td>
2
3509
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 with image populate.gif? When I click p1 or p2 button, it will post the page to process.asp. 2) When I check the checkbox, I want the image in submit button change from populate.gif to validate.gif. Unfortunately, the code InputForm.p2.src =...
2
1328
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 site - using ASP.net (Visual Basic.net or C#) code I want to edit the image by superimposing a smaller image on the lower right hand corner
4
2697
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 url effectively limit client-side image caching to the lifetime of the session? Thanks Jake
7
2287
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 Me.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
2
1963
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. You can think of it as "hooking", but it probably isn't true hooking since I'm not altering any normal calls with my own. Now, I got some image recognition code I want to use with some browser input. I don't want to use URLDownloadToFile();...
3
5249
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 database and display it in a Image web control dynamically(at runtime). The process after being displayed in the web control, user click insert/add button, it converts the image(jpeg) file to bytes and store it the database with Image or VarBinary...
6
6425
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 database and GUI so all I need is the actual algorithm preferably in pseudo code and not in the form of a research paper (from which I also found a lot but since I'm not that much interested in the actual science of image recognition this seems...
21
1576
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 to see how they hide their images. This is what I see from gettyimages.com <img src="http://cache2.asset-cache.net/xc/200186170-001.jpg? v=1&amp;c=NewsMaker&amp;k=2&amp;d=1EF4EE1EFB3A2CD3E55FD7668143826B10621193DB58D674" id="ctl12_ctlComp_imgThumb"...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9582
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10580
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10323
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10082
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6854
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.