andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Thanks a bundle...BUT

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
mikethecow
Newbie


Joined: 12 Jun 2006
Posts: 2
Location: Hove UK

PostPosted: Mon Jun 12, 2006 10:00 am    Post subject: Thanks a bundle...BUT Reply with quote

Hi Andy

Found this script today after a few weeks of attempting to roll my own version of this- you rock mate - many thanks for releasing this to the masses.

You probably don't remember but you very generously helped me (probably 2 yrs back) through another list (BNM) with a php problem i was having - I still owe you a pint for that one!

I am a numpty and am still looking on this forum for the answer so please don't be mad but - how do i return the cropped image in anyway except sending 'jpg' headers to the browser?

The image upload and crop section is the mid part of a user login and information entering sequence so I need to be able to continue beyond the 'test.cropinterface.php' stage.

Thanks again for the amazing script

Mike
Back to top
View user's profile Send private message Send e-mail
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Mon Jun 12, 2006 6:12 pm    Post subject: Re: Thanks a bundle...BUT Reply with quote

mikethecow wrote:
You probably don't remember but you very generously helped me (probably 2 yrs back) through another list (BNM) with a php problem i was having - I still owe you a pint for that one!


Of course I remember! Would never forget a guy that owes me a pint. Wink And welcome to the board.

mikethecow wrote:
Found this script today after a few weeks of attempting to roll my own version of this- you rock mate - many thanks for releasing this to the masses.


I have a new version that I can send you. I was going to wait to post it up on the site for when I had a new template, but it's looking like it's going to be ages until I get that up! So I might as well post up the new crop canvas sooner rather than later (or email it to people if they want it, of course).

mikethecow wrote:
I am a numpty and am still looking on this forum for the answer so please don't be mad but - how do i return the cropped image in anyway except sending 'jpg' headers to the browser?


OK, where did this word numpty come from? My sister's been using it for a while and she lives up by Alton Towers, and I've only recently heard people down this way use it...

Odd words aside, it's pretty easy. Looking at the demo file it has this part in it:

Code:
    if ($_GET['file'])
    {
        $ci->loadImage($_GET['file']);
        $ci->cropToDimensions($_GET['sx'], $_GET['sy'], $_GET['ex'], $_GET['ey']);
        header('Content-type: image/jpeg');
        $ci->showImage('jpg', 100);
        exit;
    }


You can remove the header line, change the showImage call to a saveImage call - the function looks like:

Code:
saveImage($filename, $quality = 100)


And then change the exit to a redirect, or return if you've got all this in a function, or more html, etc., etc.

Hell! You don't even need all this in the same file as the demo does, but obviously I did that to shorten down the amount of files needed - you could easily have it go to another file which process the information.

Hope that helps you out! If not, just let me know.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
mikethecow
Newbie


Joined: 12 Jun 2006
Posts: 2
Location: Hove UK

PostPosted: Wed Jun 14, 2006 5:10 am    Post subject: Reply with quote

Hi Andy

Thanks for the rapid response - couldn't connect to your site yesterday for some reason to post a reply.

Anyway - would be right up for the latest beta version - am currently developing this for commercial use - client loved it (cheque's in the post btw!).

Still struggling with outputting the resized hi res image but will post the results when i crack it.

'Numpty' is definately a Northern word - friends from Hull turned me on to it.

Scottish usage:
a) Someone who (sometimes unwittingly) by speech or action demonstrates a lack of knowledge or misconception of a particular subject or situation to the amusement of others.

b) A good humoured admonition, a term of endearment

c) A reckless, absent minded or unwise person

d)A person who never has or never will have a clue what he is doing

e)An idiot, a silly person

Numpty first surfaced on the terraces of west of Scotland football grounds, many many years ago. A player who couldn't hit a cow's arse with a shovel would be a numpty.


HTH



Thanks again

Mike
Back to top
View user's profile Send private message Send e-mail
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Wed Jun 14, 2006 2:15 pm    Post subject: Reply with quote

mikethecow wrote:
would be right up for the latest beta version


Will shoot that off to you in an email now.

mikethecow wrote:
Still struggling with outputting the resized hi res image but will post the results when i crack it.


On re-reading, perhaps I misunderstood you. Do you just want to return it in something other than a JPG and avoid the inherent compression that JPG goes through? If so, you can return it as a PNG (or a 100% quality JPG, I guess). If you go for PNG, then simply do this:

Code:
if ($_GET['file'])
    {
        $ci->loadImage($_GET['file']);
        $ci->cropToDimensions($_GET['sx'], $_GET['sy'], $_GET['ex'], $_GET['ey']);
        header('Content-type: image/png');
        $ci->showImage('png', null);
        exit;
    }


The current version supports JPG and PNG (if it's compiled in GD, of course) and the new version also adds GIF support (and better handling/detection of the other two formats).

If you want to have it in anything else - tiff, for example - then it's probably best you use something like ImageMagick.

mikethecow wrote:
'Numpty' is definately a Northern word - friends from Hull turned me on to it...


You know entirely too much about the word numpty Wink but thanks for explaining it!

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
bp
Newbie


Joined: 10 Jun 2006
Posts: 2

PostPosted: Wed Jun 14, 2006 6:32 pm    Post subject: Re: Thanks a bundle...BUT Reply with quote

amnuts wrote:
I was going to wait to post it up on the site for when I had a new template, but it's looking like it's going to be ages until I get that up! So I might as well post up the new crop canvas sooner rather than later (or email it to people if they want it, of course).


I want it! The currrent one is great but sounds like the update is even better. Will you be posting the link sooner or can I get a copy via email?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group