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.


database problem??

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


Joined: 19 Apr 2005
Posts: 1

PostPosted: Tue Apr 19, 2005 10:21 am    Post subject: database problem?? Reply with quote

Hi, first of i would like to say that i realy like the stuff you do. I looks great and is pretty easy to get working.

But...
Yes there had to be a but Smile
What i have been trying to do is this:
- upload an image to my site.
- pop it in the database (blob)
- grenate thumbs and pop them in the database to (blob)

wel al that works.

But if i don't like the thumbnail i want to edit the image with your cropinterface.

Sounds good uhh?
So....
Select image. fine.
See image in crop interface. fine.
Select crop area. fine.
Hit "crop the image". NO WAY! Error mesage: " .... Cannot be displayed because it contains errors."

Is this all making any sense?
It doesn't look like a problem with your stuff but more with how an image is stored and extracted from the datebase.
Do you have any idea what the isue is here. I can't imagine that i am the first person to run into this. But i haven't had much luck looking on the internet.
Back to top
View user's profile Send private message
amnuts
Site Admin


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

PostPosted: Tue Apr 19, 2005 5:40 pm    Post subject: Reply with quote

Hi tankgirl, and welcome to the board!

The problem just might depend on how you implement it. The cropping class (the parent one to the interface) supports loading from a string such a blob from the database with the loadImageFromString() method.

Now, I don't know how you've implemented displaying the image in the interface, but I would probably have the primary key for the db row returned when I submit the cropping interface (there is a thread on the board that shows a nice clean way to add additional parameters to the query string), and then do something like this:

PHP:
<?php if ($_GET['id']) {
    
$ci->loadImageFromString($db->getOne('SELECT blob FROM table WHERE id = ' $_GET['id']));
    
$ci->cropToDimensions($_GET['sx'], $_GET['sy'], $_GET['ex'], $_GET['ey']);
    
header('Content-type: image/jpeg');
    
$ci->showImage('jpg'100);
    exit;
?>


...assuming I am using something like PEAR DB instantiated into $db. Then, naturally, you can save to the blob again, or to the file system, etc.

If you've already tried something like that and it doesn't work, thenpost up what you do have and I'll try to help out where I can!

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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