473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

image manipulation...help needed

i have this situation. i have a query string:

http://www.myquerystring.com?x=xxxxx

what this url does is it will return or start downloading a .png file.
what i wanted to do is trap this png file and manipuate the image like
resizing, color...etc. how can i do this?

Jun 21 '07 #1
8 1957
Rik
On Thu, 21 Jun 2007 09:01:43 +0200, shotokan99 <so**********@yahoo.com
wrote:
i have this situation. i have a query string:

http://www.myquerystring.com?x=xxxxx

what this url does is it will return or start downloading a .png file.
what i wanted to do is trap this png file and manipuate the image like
resizing, color...etc. how can i do this?
If allow_url_fopen is enabled you should be able to retrieve & alter it
using the GD functions.
--
Rik Wasmus
Jun 21 '07 #2
allow_url_fopen is close but i can use curl. how to do it?

Jun 21 '07 #3
how to do that with gd?

Jun 21 '07 #4
shotokan99 <so**********@yahoo.comwrote in news:1182412374.565889.283240
@o11g2000prd.googlegroups.com:
how to do that with gd?
try this, which i found after 0.9 seconds of googling:

http://www.scripts.com/php-scripts/i...pts/php-image-
manipulation-class-103/

http://www.scripts.com/php-scripts/i...ation-scripts/

Jun 21 '07 #5
Are you looking to modify the PNG on the server
or the client within the browser ?

If you want to modify Server side then look at the GD library. Here
are two good links for that
www.libgd.org/Main_Page
- GD - Open Source library
http://www.codebeach.com/index.asp?t...ubcategoryID=4
- GD Tutorials

If you want to modify within the browser you might
consider use of an ActiveX component like our own
MetaDraw 3 OCX ( see www.Bennet-Tec.com) , or ImageMan ( from
DataTechniques www.Data-Tech.com ).
* MetaDraw will allow resizing, drawing / annotation, ..
by client side script or even ( if you allow ) by the
end-user with his mouse within the browser. * ImageMan
is great for things like Resizing, Rotation, Color depth
manipulation, Gamma correction, ...

* * Please include a copy of this message with your reply

-----
Jeff Bennett
Je**@Bennet-Tec.Com
* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================

On Jun 21, 3:01 am,
shotokan99 <so**********@yahoo.com>
wrote:
i have this situation. i have a query string:

http://www.myquerystring.com?x=xxxxx

what this url does is it will return or start downloading a .png file.
what i wanted to do is trap this png file and manipuate the image like
resizing, color...etc. how can i do this?
======================================

Jun 21 '07 #6
actually i was able to work it out using this code:
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $xmyurl);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
curl_close($ch);

and display the output this way:
header("Content-type: image/png");
echo $image;

now what i want to do is edit that $image as png file using gd. i
tried it:
header('Content-type: image/png');
$xbase = @imagecreatetruecolor(130,168);
$xback=imagecolorallocate($xbase, 39,138,8); //green
imagefill($xbase,0,0,$xback);
imagecopy($xbase,$image,0, 28, 0, 0, 130,140);
imagepng($xbase);

what supposed to happen is $image should be inside $xbase frame.
however it doesnt work, instead only $xbase is showing. what to do
with this?

Jun 22 '07 #7
actually i come up with this:
ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $xmyurl);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
curl_close($ch);

and display the output this way:
header("Content-type: image/png");
echo $image;

now what i want to do is edit $image as png file using gd. i tried it:
header('Content-type: image/png');
$xbase = @imagecreatetruecolor(130,168);
$xback=imagecolorallocate($xbase, 39,138,8); //green
imagefill($xbase,0,0,$xback);
imagecopy($xbase,$image,0, 28, 0, 0, 130,140);
imagepng($xbase);

what supposed to happen is $image should be inside $xbase frame.
however it doesnt work, instead only $xbase is showing. what to do
with this?

Jun 22 '07 #8
Rik
On Fri, 22 Jun 2007 05:07:24 +0200, shotokan99 <so**********@yahoo.com
wrote:
actually i come up with this:
ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $xmyurl);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$image = curl_exec($ch);
curl_close($ch);

and display the output this way:
header("Content-type: image/png");
echo $image;

now what i want to do is edit $image as png file using gd. i tried it:
header('Content-type: image/png');
$xbase = @imagecreatetruecolor(130,168);
$xback=imagecolorallocate($xbase, 39,138,8); //green
imagefill($xbase,0,0,$xback);
imagecopy($xbase,$image,0, 28, 0, 0, 130,140);
imagepng($xbase);

what supposed to happen is $image should be inside $xbase frame.
however it doesnt work, instead only $xbase is showing. what to do
with this?
An image resource is NOT the raw data. Get the image, store it temporarily
on you computer, create an image resource with an imagecreatefrom*()
function and you've got it.

--
Rik Wasmus
Jun 22 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rune Johansen | last post by:
Hi. I'm doing some image manipulation in an applet using the example code on this page: http://www.akop.org/art/pixels3.htm However, I really want an application rather than an applet, I just...
9
by: Job | last post by:
Hi, I would like to find out what ASP/ASP.net can do with image manipulation. Does ASP have built in functions (eg. after upload to server) to manipulate images, like rotate, scale, crop etc.?...
3
by: peterf | last post by:
Posted in alt.comp.lang.php before I saw how much more active this group is... Hope someone can help. I am new to this group and needing a little bit of guidance. First off I need to say that...
9
by: zacariaz | last post by:
I dont know, and i dont much like javascript, however, i am told that the only way to do want i want to do, is with javascript, so here goes. zoom and cut is the only features i need. 1. the...
7
by: kebalex | last post by:
Hi, I have an app (written in .NET 2.0) which updates a picturebox according to some user input (a slider control). when the user makes a change i loop through all of the pixels, do a...
2
by: Michiel Sikma | last post by:
Hello everybody. I'm currently involved in a site building project in which we're going to use the Google Maps API. The user will be able to browse the site by looking over a really large image,...
0
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
12
by: laredotornado | last post by:
Hi, I'm using PHP 5. I was wondering given an image, a.jpg, how can I make an image that would look like you slid a white index card (which I have a file, white.jpg with the same dimensions as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.