Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOtherTutorials

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old November 20th, 2003, 10:20 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Image Gallery restrictions

Couldn't believe that there was an Image Gallery tutorial on here, and so with abaited breath got GD installed on a Apache web server and configured a quick script to ensure that the GD .DLL was loaded etc and working correctly - of course, then realised that
php Code:
Original - php Code

also included it in it's report.

However, whilst testing this tutorial out, I'm finding that GD doesn't appear to create the thumbnails that I was expecting - in fact all I'm seeing is broken image links. The graphics that I'm browsing can be quite large, and I'm wondering if there are any restrictions in the filesize of the jpeg's (ranging from 5Kb - 732Kb on a test sample of 26images)

The script does appear to be reading my (Windows2000) folder, as the correct number of images appear etc, but just not the scaled down images? Any ideas?? (and phpinfo() reports that JPG support is enabled)

GD = 2.0.15
OS = Windows 2000 Professional, SP4
PHP = 4.3.4
API = Apache 2.0 Handler

Tutorial used from http://codewalkers.com/tutorials.php?show=53&page=1

Reply With Quote
  #2  
Old November 20th, 2003, 10:25 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

the last time somebody had this problem, it turned out that they didn't have the three files from the tutorial in the same folder together. and the time before that, it was because they weren't using the full server path within the configuration file.

Reply With Quote
  #3  
Old November 20th, 2003, 10:37 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

Notepad,
Thanks for replying so quickly.

All PHP files are in the same folder, and have already checked if they need to be in the actual images folder, and the same thing happens, just broken image links.

Full path is in the config.php file, and again I've tried with and without the drive letter (even though test system only has one drive) - still no bananas... (or images ;o))

Even tried backslashes as opposed to forward, but just got errors on that...

I was thinking that this would've been a GD problem maybe, rather than a PHP one, as the correct number of images is listed when I click on the View ALL link...

Reply With Quote
  #4  
Old November 20th, 2003, 10:49 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

i don't think you have the right path in your config file. lemme see your phpinfo file

Reply With Quote
  #5  
Old November 20th, 2003, 10:57 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

(phpinfo() info sent via personal message)

Reply With Quote
  #6  
Old November 20th, 2003, 11:02 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

and interestingly enough, right clicking on each broken image link (in this case an image called "phone3-microracer.jpg") shows the correct filename (ie, http://localhost/image_gallery/imgsrc.php?src=/apache2/htdocs/images/phone3-microracer.jpg)

Reply With Quote
  #7  
Old November 20th, 2003, 11:06 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

maybe your path is case sensitive? try:
php Code:
Original - php Code
  1.  
  2. define('PATH', '/Apache2/htdocs/setup/images/');

capital "A" there..

Reply With Quote
  #8  
Old November 20th, 2003, 11:10 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

Nope, Windows2000 doesn't worry about things like that (sometimes a good thing, sometimes not so!) but again, have tried and no joy sir...

I just can't help but think that theres a problem with GD - the script pulls up the correct number of images, as well as the image names themselves (see posting above about right clicking on the broken image itself) but I can't understand what could be the problem...??

Reply With Quote
  #9  
Old November 20th, 2003, 11:12 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

well okay, run a test GD script to see whether or not the library is working..
php Code:
Original - php Code
  1.  
  2. header ("Content-type: image/jpeg");
  3. $im = @imagecreate (50, 100) or die ("Cannot Initialize new GD image stream");
  4. $background_color = imagecolorallocate ($im, 255, 255, 255);
  5. $text_color = imagecolorallocate ($im, 233, 14, 91);
  6. imagestring ($im, 1, 5, 5"A Simple Text String", $text_color);
  7. imagejpeg($im);
  8. imagedestroy($im);

Reply With Quote
  #10  
Old November 20th, 2003, 11:19 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

Ok, get a small image, white background with "A Simple" text in purple...

Reply With Quote
  #11  
Old November 20th, 2003, 11:30 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

well that means the library is working. the reason i believe that you're getting dead images, is because imgsrc.php is not recognizing the PATH that it is being sent.

does that make sense?

Reply With Quote
  #12  
Old November 21st, 2003, 12:03 AM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

You think it's got something to do with rawurlencode?

I guess the crucial line in images.php is
php Code:
Original - php Code
  1. print('<img src="imgsrc.php?src='
  2.                  .PATH.rawurlencode($uri).$image.'" border="0" />');
yes?


Reply With Quote
  #13  
Old November 21st, 2003, 12:23 AM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

yea that's the crucial line.. how about changing it to:
php Code:
Original - php Code
  1.  
  2. print('<img src="/YourFolder/imgsrc.php?src='.PATH.rawurlencode($uri).$image.'" border="0" />');

???

Reply With Quote
  #14  
Old November 21st, 2003, 10:19 PM
Netmaster Netmaster is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 9 Netmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Image Gallery restrictions

Nope, still no wonderfully recreated images on my page.
What I've also done to check the accessing of these images is use a screen capture utility to capture the information that's listed in Internet Explorer's toolbar...

The AVI shows that each image being called fine, such as:
(11 items remaining) Downloading picture http://localhost/gallery/imgsrc.php?src=/Apache2/htdocs/images/phone3-microracer.jpg...

(just thinking - the src= *is* the file structure path determined by PATH in the config.php file isn't it, and not a relative address from within the website?)


Dave

Reply With Quote
  #15  
Old November 21st, 2003, 10:37 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Image Gallery restrictions

correct, src is the full server path to the image, not the standard web folder address.

i've been playing with the script on my own system, and apparently (depending on how your script files/folders are arranged, like if storing images outside the webtree) you may need to alter the line as mentioned within my previous post.. but you say that doesn't work and i can't really think of any other reason why it shouldn't work

i could be a lot more helpful if you had a visual example thrown up. or if you could provide a directory listing of your system, so i can see where the gallery files are stored and where the images folder is, etc.. that way i could simulate the same setup.

this doesn't look right to me

/localhost/gallery/ "gallery files"
/Apache2/htdocs/ "images folder"

Reply With Quote
Reply