Development Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsCommunityDevelopment Tutorials

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 5th, 2003, 03:23 PM
iahmed iahmed is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: USA
Posts: 171 iahmed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 58 sec
Reputation Power: 16
REMOVED

Reply With Quote
  #2  
Old September 11th, 2003, 07:05 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
iahmed,

I'm sorry you feel that way... I wanted to write the article to address all levels of PHP knowledge, not just an advanced user. Had I written it in an advanced context, I'm sure I could have completed it in a single article as well.

The fact that I introduced a class and OO concepts demanded more "introductory" explanations... Also, GD can be a complicated topic for beginners, so I felt that the article warranted detailed explanation.

I do appreciate the feedback, however... It has given me an idea on how to write my future article.

Thanks again!
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old September 12th, 2003, 10:43 AM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Bugs

Frank,
Does this work on your server? It doesn't work on mine.

In GallerySizer.php the copyImage and copyResize methods don't work.

I had to replace copyImage with:
PHP Code:
function copyImage()
        {
      
imagejpeg($this->thumbTHUMB_BASE.$this->thumbnail); //creates the thumbnail
      
return true;
    } 


I had to replace copyResize with:
PHP Code:
function copyResize()
        {
        
imagejpeg($this->resizeIMAGE_BASE.$this->converted);
        
        
// Delete the original uploaded image
        
if(!@unlink(IMAGE_BASE $this->image_file))
                {
          echo(
"Error processing file... Please try again!");
          return 
false;
        }
        return 
true;
    } 


I don't know the need for the "copy" function since the "imagejpeg" function creates the image in the images and thumbs folders.

The chmod function always produced errors. I didn't need the unlink functions except for the one that deletes the orginal.

There are several other bugs that are causing me trouble as well. Right now I'm going to have to figure out the edit_photos.php page. It is not displaying the images correctly.

Nice set of articles, except for the buggy code. I think I can figure it out, but I think the amount of bugs will make this a frustrating waste of time for someone who is not that experienced with php.

Reply With Quote
  #4  
Old September 12th, 2003, 11:22 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
eqjones,

It's very odd that you're having problems with the edit_photos.php page. Do you have a live version up that I can take a look at?

As for the copy() function, I was finding that after the imagejpeg() function was creating the resized/thumbnailed copies, it was storing those new images in the "temp" folder. By using the copy() function, it would copy them to the photos/thumbs folders.

If you have any other problems, please let me know...

Attention
For all those who were waiting, the support file has now been updated to include the "fully tested code"

Reply With Quote
  #5  
Old September 12th, 2003, 12:04 PM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To Frank,
Thanks for the quick response. I downloaded the code either yesterday or the day before yesterday. Is there updated code now?

I noticed in the gallery when looking at the pictures, the display_album.php page, the date was always showing up as the 1st, even when I didn't upload the pictures on the first.
I traced the problem back to the "format_date" function in the config.php file.

The date is split by "-" which leaves the $day holding a value like "11 21:55:55". So this is split by the space using:
PHP Code:
 $day[] = split(' '$dd); 

However that creates a nested array that looks like:
Code:
Array
(
    [0] => Array
        (
            [0] => 11
            [1] => 21:56:03
        )

)

As a result a valid day value wasn't given to the "mktime" function. To fix this I rewrote the line to
PHP Code:
 $day split(' '$dd); 
. That fixed it.

Reply With Quote
  #6  
Old September 17th, 2003, 05:54 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
eqjones,

The code is now updated... To make sure you have the updated copy, there should be a "filler.gif" file located in the include directory.

As for the date bug, that's weird... I had no problems on my system here. Althought it shouldn't make a difference, what OS are you running?

I'll have to look into it...

Reply With Quote
  #7  
Old September 19th, 2003, 05:32 PM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
To Frank,
It's great that you are replying to this forum. I appreciate your time to do that and to write the article. I had been working on a image uploading thing like you wrote about before your article. It was no where near as classy as yours and your use of the classes really helps me understand more how classes work into the whole scheme of things.

I am using a shared server using a reseller accoung that uses Cpanel and WebHostManager. It has the Redhat Linux, PHP, and mySQL on it. The problem that I was having with the pictures not getting copied might have something to do with the server being a shared one. When I uploaded the pictures they went to the "photos" folder, not the "temp" folder. I didn't even see a "temp" folder. I don't know a lot about setting up linux, php, mysql servers and I have never had a dedicated server, so I'm thinking that it may have something to do with me using a shared server. The changes I mentioned seem to work fine for me.

I downloaded the new code the day I posted my last post. It was updated from the first copy I downloaded. I'm not sure if you've updated it more recently though. I still had some bugs with it. The problem was, the Title and Description for the last picture of the upload list would overwrite all the other Titles and Descriptions in the SQL query. For example if I uploaded 4 pictures and set Pic4's title="Picture Four" and Pic4's Description="Picture Four Description", then the three other pictures would also be titled and described with Pic4's values.

Easy fix, which you might have alread done:
in image_upload.php, in the part where the values in the form is set, change this:
PHP Code:
echo("\n<tr>\n<td $style width='15%'>Image Title : </td>\n<td $style><input type='text' name='photo_title'></td>\n</tr>");
echo(
"\n<tr>\n<td $style valign=\"top\">Photo Description: </td>\n<td $style><textarea name='photo_desc' cols='30' rows='6' wrap='default'></textarea></td>\n</tr>"); 

to:
PHP Code:
echo("\n<tr>\n<td $style width='15%'>Image Title : </td>\n<td $style><input type='text' name='photo_title".($i 1)."'></td>\n</tr>");
echo(
"\n<tr>\n<td $style valign=\"top\">Photo Description: </td>\n<td $style><textarea name='photo_desc".($i 1)."' cols='30' rows='6' wrap='default'></textarea></td>\n</tr>"); 


The problem was the "photo_desc" and "photo_title" variables have to be different for each picture otherwise the values will overwrite each other. By inserting "$i+1" we insure each photo get's it's own variable...ie.. "photo_desc1", "photo_desc2", etc.

We also have to change the SQL statement that adds the photo's entries to the database. So in create_thumbnails.php we want to change:
PHP Code:
 $sql "INSERT INTO photos values(0, '" addslashes($_POST[photo_title]) . "', '" addslashes($_POST[photo_desc]) . "', NOW(), '$image_location', '$thumb_location', $_POST[album_id])"

to:
PHP Code:
 $sql "INSERT INTO photos values(0, '" addslashes($_POST[photo_title.$i]) . "', '" addslashes($_POST[photo_desc.$i]) . "', NOW(), '$image_location', '$thumb_location', $_POST[album_id])"


All we are doing here is concatonating (sp?) "photo_desc" and "photo_title" with the counter "$i" that is being used in that file.

We will also have to pass the "$i" variable to the function, so that'll have to be added to the function call and the function title (? I guess that's the correct terminology).

Works like a charm

Thanks again for the responses and article. I look forward to playing more with this as I have time.

Reply With Quote
  #8  
Old September 19th, 2003, 06:47 PM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was also having a problem with the "edit_photos.php" file. It wanted to display all the pictures, but use the album cover image as the thumbnail, instead of the image's actual thumbnail image.

I think it would have been a lot better if you had made the edit_photos.php file like the gallery view files. You know, first you select the album, and then it gives you the images. I didn't rewrite it to do that, don't have the time right now. But I did, fix the bug.

The problem is that in the last elseif group, the img src is putting the value of the album cover instead of the value of the thumbnail. Also, the SQL statement doesn't fetch the value for the thumbnail. So I changed:
PHP Code:
 $msg .= ($row['photo_title'] . "<br /><img src=\"../" $row['album_cover'] . "\" /></td>\n"); 

to:
PHP Code:
 $msg .= ($row['photo_title'] . "<br /><img src=\"../" $row['thumbnail_location'] . "\" /></td>\n"); 

and I changed:
PHP Code:
 $sql "SELECT photos.photo_id, photos.photo_title, albums.album_cover FROM photos, albums
WHERE photos.album_id = albums.album_id"


to:
PHP Code:
 $sql "SELECT photos.photo_id, photos.photo_title, photos.thumbnail_location FROM photos, albums 
WHERE photos.album_id = albums.album_id"


Reply With Quote
  #9  
Old September 20th, 2003, 04:01 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
eqjones,

That may have something to do with it... When I tested it out on my server, it was here at home, so that may be the reason why they were being copied to the temp folder.

As for the changes you've made, I'm glad you've been able to make them. It shows you're level of knowledge. It's weird that I didn't run into these problems myself. I'm gonna look into it here on my end, and see if I encounter the same problems you have.

If you have it online, I'd like to see how you've employed the gallery.

If you have any other questions, don't hesitate to post them!

Reply With Quote
  #10  
Old September 23rd, 2003, 10:29 AM
sven sven is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Belgium
Posts: 5 sven User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello,

Thanks for the article Frank. It shows a clear way of how it's possible
to create an Image Gallery.
As said before.. maybe the article is a bit long. But of course , better
too long than too short.
The only thing that disappoints me in general in all articles.. is the
yellow background when there's PHP code. It really makes it hard(er) to
read and understand the code.
It makes a huge difference when you see the code with neat highlighting.
If syntax highlighting isn't possible for technical reasons.. then I
prefer no background at all. Besides that, this is a great site with
lot's of info.

About the article itself.
I haven't used it so I'm not aware of bugs. I only read it.
What I found really good is the example of how to use classes in this
project. There's a lot to read about OOP, but mostly it's a theory
approach. This article helps me understand how to integrate a class in a
project.

I'm working on an Image Gallery myself. But I'm still having doubts
about where the destination path of images should go.

Maybe,

$root.'/thumbs/'.$gallery_id.'/'.$thumb_img
and
$root.'/images/'.$gallery_id.'/'.$full_img
is an option.

Another directory layout could be:

$gallery_id.'/thumbs/'.$thumb_img
$gallery_id.'/images/'.$full_img

Are there any special pro's and con's I'm not aware of? Or is it just a
matter of how you personally prefer it?

Another thing I found interesting is the use of two tables, and use a
'key' to link the id's.
A very usefull method to create forums too, where their can be a table
for topics and replies.

Thanks again to share your knowledge and your time to write the article.

-sven

Reply With Quote
  #11  
Old September 24th, 2003, 05:06 PM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Not sure exactly what you are trying to do, but I didn't like the thumbnails and resized full images having the same name. So I just added a "_tn" to the name of the thumbnails. I was happy with the photos table. It was a ton better than what I had done one my own before I read the article.

When it comes to the yellow print, I'm ok with that too. However, I do choose the "print" option and copy and past into a MS Word document. I then shrink the font, do some more editing to shrink the size so I have less pages and print it out. I can work and learn much better with the print copy, and I can take it with me and study it away from my computer.

I have found possibly a bug in the resizing file. Not sure if it's something I've done though, but I don't think I've messed with that part of your code. I haven't gone through the resizing file checking how it was done yet to see if I can figure out what's happening. I'm going to work on templates and CSS first (again). But I uploaded a picture that was more tall than wide and it stretched the picture. It made it more squarish. Frank, if you want a link, I'll email it to you, but don't want to post it since I haven't put my sessions stuff in the upload files. Of course not asking you to trouble shoot my code.

Reply With Quote
  #12  
Old September 24th, 2003, 05:21 PM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I also wanted to add that I agree with Sven. You did a great job utilizing the classes in this tutorial. I found using classes much more difficult than GD. I've only taken freshman level Comp Sci classes back when C++ was being used and things were written more proceduraly than OOP. I have some trouble figuring out OOP.

I think you could write a great article on OOP and classes in PHP. Would be cool if you could write a tutorial on using OOP in a template system. Leave out the caching bit, that makes it much more complicated. Would be great for me, lol. I'm trying to figure out how I can use classes and use templates.

I guess with classes, if code is often rewriten (copy and pasted) in files then I can use a class to keep from having to rewrite it. I want to set up a header, left side, center, right side, and footer. Most of the time the center will only be what's different. The rest is rewritten.

But anyways, I think you'd do a great job writing an article like that.

Reply With Quote
  #13  
Old September 24th, 2003, 06:07 PM
sven sven is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Belgium
Posts: 5 sven User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by eqjones

I have found possibly a bug in the resizing file. Not sure if it's something I've done though, but I don't think I've messed with that part of your code. I haven't gone through the resizing file checking how it was done yet to see if I can figure out what's happening.

Eqjones,
For resizing images I first get the ratio to resize it.
So basically, if the width of my image is 500px and I want to resize it to maximal 250px, I would want a ratio of 2.
Then I do 500 / 2 what creates the desired 250px width.
An extra if statement, checks if the ratio is smaller or bigger than 1.
ie:
If my original image is 300px, and the resize destination is 600, the ratio is 0.5 (smaller than 1). So I do nothing, (return 1).
If the source image is smaller than the destination, the image doesn't have to be resized at all.
300 / 1 keeps the original size.

In my ImageManipulator class, I use the method below to do that.
(keep in mind that i'm a oop beginner myself, so don't expect this to be a good solution).

greetings,
-sven

ps: more OOP tutorials would be great indeed :-)

PHP Code:
<?php

    
function getFullRatio(){
        
$ratiow $this->width IMG_MAXW;
        
$ratioh $this->height IMG_MAXH;
        print 
"  ratiow : $ratiow | ratioh: $ratioh <br>\n";
        if( 
$ratiow >= $ratioh ){
            
$this->fullratio $ratiow;
        }else if( 
$ratiow $ratioh ){
            
$this->fullratio $ratioh;
        }
        if(
$this->fullratio 1){ $this->fullratio 1; }
        return 
$this->fullratio;
    }
?>

In the main php script I do something like:
PHP Code:
<?php
$img 
= new ImageManipulator("foo.jpg");
$img->getImageProperties();
$img->getFullRatio();
$img->DestinationSize($img->width$img->height$img->fullratio);
$img->CreateImage("full_");
/*
  And now the image full_foo.jpg is   created, in the same directory.
*/
?>

Last edited by sven : September 24th, 2003 at 06:15 PM.

Reply With Quote
  #14  
Old September 25th, 2003, 06:08 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Thanks for the feedback! I appreciate it... I'll definitely look into writing an article on OOP!

As for Sven's question regarding the directory structure... It's simply a matter of preference. I didn't take creating seperate directories into account... Although it's something I should have considered.

As for the aspect ratio, I'll look into it... When I tested my images, I didn't notice any distortion; although I'll have to double-check whether or not I used any images that could have caused the distortion (images smaller than 800x600). Sven's method seems like a viable solution...

Thanks again for the feedback!

Reply With Quote
  #15  
Old September 25th, 2003, 10:23 PM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks Sven... egads, math

This is the picture that I used that got stretched:

CH-46 Sea Knight

It is a large picture.

Reply With Quote
  #16  
Old September 26th, 2003, 03:49 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Hehehe... I know... MATH!

eqjones,

I tried the link and it gave me this:

Quote:
The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. Please inform the site administrator of the referring page.


Is it offline?

Reply With Quote
  #17  
Old September 26th, 2003, 06:08 PM
sven sven is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Belgium
Posts: 5 sven User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hello,

Yes, the image was not found.

You are right, the directory layout is only a matter of preference. Currently I
have an $id/full and $id/thumbs layout for every gallery. Another idea that came
across (actually when I read eqjones reply), is when creating the directories,
copy or create an empty (or other) index.html file in every directory. This
prevents directory listing of your images. :-)

When I speak for myself, it takes me more time to develop an image gallery
system when I do it in an object oriented way than a procedural one. But this is
probably because I'm still learning it. I'm sure if you understand design
patterns etc., it can benefit your PHP applications a lot.
The thing I find most difficult in OOP (at this moment), is building iterators
that get data from a MySQL database, with the purpose to seperate your PHP code
from content and HTML layout.
Also making two or more classes work together, is still tricky.
ie.: a File Upload class and the Image class, Database Connection etc.
I don't know if experienced developers had the same problems, before they knew
object oriented programming inside out.
But that's how I'm feeling about it right now.

Anyway, it's fun to see small parts or classes work and grow bigger.
And a lot of practice can do magic.
I'm looking forward to PHP5.

greetings,
-sven

Reply With Quote
  #18  
Old September 29th, 2003, 02:55 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Sven,

It's all a learning process... I'm by no means an OO guru... I'm a student!

You'll find that once you start using an Object Oriented approach, piecing small chunks of code (classes) into a larger application will be much easier and quicker.

But don't sweat... It's not going to happen overnight... As long as you're learning something new, you'll never get bored!

Reply With Quote
  #19  
Old October 4th, 2003, 08:13 PM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 16
Question Help?

Could somebody help me with this problem? After read the articles, downloaded the support files, configured and uploaded them on my web host service. Everythings went right, but when uploading photo it seems the photo could not be renamed. I got a error message below:
Quote:
Still here!
Warning: imagejpeg(): Unable to open 'yennhi_041003_200331.jpg' for writing in /home/moviebooms/public_html/dev/onlinealbum/admin/GallerySizer.php on line 162
Error processing file... Please try again!Images successfully converted and stored!
Click here to continue.

Greatly appreciated for your help.

Reply With Quote
  #20  
Old October 5th, 2003, 09:12 AM
sven sven is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Belgium
Posts: 5 sven User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by FrankieShakes
Sven,
As long as you're learning something new, you'll never get bored!
Yes, true. And it has been a long time that I was bored
(actually, since I have a computer, I never was.)

Reply With Quote
  #21  
Old October 5th, 2003, 09:30 AM
sven sven is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Belgium
Posts: 5 sven User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Help?

Quote:
Originally posted by wareseeker
Warning: imagejpeg(): Unable to open 'yennhi_041003_200331.jpg' for writing

I'm not sure, but that looks to me that you don't have write access in the directory where the image is created.

Reply With Quote
  #22  
Old October 5th, 2003, 09:56 AM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 16
Thanx!

I did "chmod' those directories into 777, the file actually uploaded but not renamed. Any clue?

Reply With Quote
  #23  
Old October 5th, 2003, 10:23 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
On a whim here, is it a shared host?! I can't imagine you not having write access (due to your host disabling it)... but I would suggest contacting them to find out.

Reply With Quote
  #24  
Old October 5th, 2003, 10:24 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 18
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Quote:
Originally posted by sven
Yes, true. And it has been a long time that I was bored
(actually, since I have a computer, I never was.)


I feel the same way!

Reply With Quote
  #25  
Old October 5th, 2003, 11:40 AM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 16
Quote:
On a whim here, is it a shared host?! I can't imagine you not having write access (due to your host disabling it)... but I would suggest contacting them to find out.


I have a static IP for my host account. Do you think I am on a shared host?

Reply With Quote
  #26  
Old October 7th, 2003, 10:00 AM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Warseeker, I had the same problem. What happened was that the image I was uploading was not going to a 'temp' directory. Frankie said that his was. The difference may be that he is not using a shared server and I was. He had a 'temp' folder and I didn't. I posted my fix somewhere above.


For the picture that I had that was getting warped when resized, let's try these links:

Sea Knight

Reply With Quote
  #27  
Old October 7th, 2003, 04:44 PM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 16
Thanx! but link didn't work.

Reply With Quote
  #28  
Old October 10th, 2003, 12:42 AM
Ra` Ra` is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Melbourne, Australia
Posts: 1 Ra` User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Ra`
Everything seems to be working okay except i get the following errors when trying to add an image to an album.

Please help.

Warning: copy(../photos/ra_poser.jpg) [function.copy]: failed to create stream: Permission denied in /home/virtual/site67/fst/var/www/html/phpgallery/admin/create_thumbnails.php on line 22

Warning: imagecreatefromjpeg(../photos/ra_poser.jpg) [function.imagecreatefromjpeg]: failed to create stream: No such file or directory in /home/virtual/site67/fst/var/www/html/phpgallery/admin/GallerySizer.php on line 59
Still here!Images successfully converted and stored!
Click here to continue.

Reply With Quote
  #29  
Old October 14th, 2003, 09:19 AM
eqjones eqjones is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: South Carolina
Posts: 18 eqjones User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ROFL, I tested the link right after I posted it. Oh well, guess I can't link to it.

Ra' I had the same problem. It has been discussed in this thread in a previous post. The author's files go to a 'temp' directory when he uploads them. Mine do not, I don't even have a 'temp' directory. I think it's because I am using a shared server using CPanel. I had to adjust the code to fix the problem and I posted how I did it in a previous post in this thread.

Reply With Quote
  #30  
Old November 26th, 2003, 07:55 AM
breadwild breadwild is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Illinois
Posts: 1 breadwild User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
GD not a high quality module

Frank,
I have written my own image browser in Perl and MySQL, but I'm curious how you found GD's optimization. I found it, quite frankly, sucky. Very poor quality, even at the highest settings. Compared to Photoshop optimizations, well...there was no comparsion. I'd love to try ImageMagick, but my host doesn't and won't support it.

Brad

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsCommunityDevelopment Tutorials > Article Discussion: Creating An Online Photo Album with PHP and GD: Part 4


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap