Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Helping me might help lots of people


Recommended Posts

I've been stepping through the imaging code in html_output.php.


I'm generating feedback by addending a dummy "alt=" tag to my images. I started testing by simply proving that I could feedback constants and self-created dummy variables. It worked, so my process is legitimate. Then I advanced to feeding back the $width and $height variables. No problems.


My problem is that I'm getting back empty values for all of the following: $image_size, @getimagesize($src), $image_size[0], and $image_size[1].


If you're familiar with the imaging code (built-in or some of the contributions like "Constrain Proportions"), you realize that these values are key to the process.


I've seen lots of people post things like "setting width to (empty) and height to 'x' doesn't generate images of height 'x' and variable width, as it's supposed to". I still haven't found an explanation given, because most of the feedback seems to assume the questioner is doing something wrong, and I don't think they are..... I think they're not getting the same functionality as everyone else. I fall into that category. If my image is 600x300, and I set either height to (empty) width to 200, I get full-size images, not images with width=200.


If someone can tell me [us] why the image_size variable is empty when it presumably shouldn't be, I think that would pave the way to clear everything up.


As mentioned, I think lots of people are suffering from this problem.



Link to comment
Share on other sites

I've discovered something that has let me achieve a solution, albeit a possibly imperfect one.


I discovered that getimagesize() was not feeding me back values for relative references, whether they started with "/" or not. Therefore, I inserted the following code to handle this.....



if (substr($tempsrc,0,9)=="/catalog/") {

$src = "http://www.topshelfselection.com";

} elseif (substr($tempsrc,0,8)=="catalog/") {

$src = "http://www.topshelfselection.com/";

} elseif (substr($tempsrc,0,1)=="/") {

$src = "http://www.topshelfselection.com/catalog";

} else {

$src = "http://www.topshelfselection.com/catalog/";


$src .= $tempsrc;


After a simpler implementation (w/o all the forks) first, I ran into a couple of goofy problems that was fixed by adding the other forks. Obviously, the 3rd and 4th are a little bit leaps of faith, but I haven't found any negative fallout yet.


That's also probably really sloppy because I'm new at php, but it seems to have worked for me. Now, I really do get images of widtgh = 100 when I set height=(blank) and width=100.


If anyone has anything to add or to make it more eloquent, I'd welcome it.



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...