473,769 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2013
Rik
On Thu, 21 Jun 2007 09:01:43 +0200, shotokan99 <so**********@y ahoo.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**********@y ahoo.comwrote in news:1182412374 .565889.283240
@o11g2000prd.go oglegroups.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**********@y ahoo.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_CONNECT TIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_BINARYT RANSFER, 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 = @imagecreatetru ecolor(130,168) ;
$xback=imagecol orallocate($xba se, 39,138,8); //green
imagefill($xbas e,0,0,$xback);
imagecopy($xbas e,$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_CONNECT TIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_BINARYT RANSFER, 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 = @imagecreatetru ecolor(130,168) ;
$xback=imagecol orallocate($xba se, 39,138,8); //green
imagefill($xbas e,0,0,$xback);
imagecopy($xbas e,$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**********@y ahoo.com
wrote:
actually i come up with this:
ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, $xmyurl);
curl_setopt ($ch, CURLOPT_CONNECT TIMEOUT, $timeout);
// Getting binary data
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
curl_setopt($ch , CURLOPT_BINARYT RANSFER, 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 = @imagecreatetru ecolor(130,168) ;
$xback=imagecol orallocate($xba se, 39,138,8); //green
imagefill($xbas e,0,0,$xback);
imagecopy($xbas e,$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
5442
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 can't figure out how to do the image loading and manipulation when it's not from inside an applet. Any hints on the subject are appreciated.
9
2151
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.? Or are 3rd party solutions needed to do this? I am a php/codfusion programmer and know nothing about asp, so I'm hoping somebody here can help me out.
3
1524
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 I'm also new to php but am certain that I could work with it enough to accomplish this task so please be patient with my question. I'm trying to find if possible, a script that would allow the viewing of two different images side by side on the same...
9
3378
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 image that need manipulating is places on the server. dont need js for that ;-) 2. the client has the oppotunity to manipulate the image. cut and zoom. 3. the image i saved on the server.
7
6045
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 calculation and update the picture. i currently use the GDI SetPixel method on each pixel of the Pictureboxes image. This is proving far to slow, about 1.5 seconds on average. This app needs to display the update as fast as possible. Has anyone got any...
2
1806
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, similar to how Google Maps itself works, except with the design of the site on the background rather than a map of the world. I initially hired someone to do it in PHP (don't bite, please :-) but it seems that I forgot about one thing: the...
0
2585
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 Manipulation Profiling Tools Set is a set of advanced tools that help Serious Traders analyze the market direction, market manipulative behavior and predicting the change of trend.
0
2350
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 new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market Manipulation Profiling Tools Set is a set of
12
2968
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 a.jpg) over a.jpg? Note that you'd be sliding the image from top to bottom or from left to right, but not both. Thanks, let me know if this makes sense ... it's a litlte hard to describe.
0
9423
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
10049
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...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
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 we have to send another system
2
3564
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.