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.


Display a cropped jpg preview, then apply to original .TIF?

 
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
gio
Newbie


Joined: 27 Oct 2005
Posts: 4

PostPosted: Thu Oct 27, 2005 11:22 pm    Post subject: Display a cropped jpg preview, then apply to original .TIF? Reply with quote

Firstly, thanks for making such an awesome script Very Happy

I've got a couple of burning questions but first some background -
I have a bunch of images and for each, there exists a JPEG copy and a TIF copy (i.e. /low-res/test.jpg, /originals/test.tif).

The desired scenario is:

1. User selects a jpeg from a page of thumbnails.

2. Cropping interface loads the jpeg (i.e. low-res/test.jpg)

3. User crops image as desired then sees the cropped image along with 'save' and 'cancel' buttons

4. 'save' button applies the crop to the original TIF file (i.e. low-res/test.tif).


So, my questions are:
    Is it possible to apply the crop (via cropToDimensions & SaveImage) to TIF files? (is this fortmat supported?)
    Is it possible to display the cropped image preview in the html page without first saving it somewhere temporary? (how does one refer to it in <img src> ?)
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Fri Oct 28, 2005 7:51 am    Post subject: Reply with quote

Hi Gio, and welcome to the board.

The GD library, which the crop canvas class uses, does not support tif images. However, if you have the imagemagick package or netpbm, then you could call those with the cropping dimensions via a shell execution and have them crop your tif (or both your images).

To show the image in am img tag without saving it you'll ned to use an intermediate page. Your cropping interface would submit to your 'display' page which would then in trun call the cropping processor with an image tag like:

<img src="showcrop.php?sx=n&sy=n&ex=n&ey=n">

(where n is value passed from the interface along the query string).

See this thread for an example of what I mean:

http://php.amnuts.com/forums/viewtopic.php?t=79

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


Joined: 27 Oct 2005
Posts: 4

PostPosted: Tue Nov 01, 2005 3:03 pm    Post subject: Reply with quote

Thanks Andy - I will look into the imagemagick package.
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