tags:

views:

17

answers:

2

In php when I called echo image with the dynamics path it shows some images in small size and some in actual size. most time the intermediate images are shown small in browser

<td align="center">

<?php $image_path = "components/com_mediaonline/uploads/uploads/" . $row["photo_id"] . "/thumb/" . $row["filename"]; ?>

<a href="<?php echo $base_url . "&task=" . $operation_model_photoset_photo_click  . "&photoset=" . $photoset . "&model_id=" . $model_id . "&filename="  .  $row["id"] ;?>"><img style="border:2px solid #ccc;" src="<?php echo  $image_path; ?>"  alt=""></a>

</td>   

what you think whould be the reason for this

+1  A: 

Your code is not forcing any size info on the image, so the reason has to be elsewhere, either in the files themselves, or possibly some obscure CSS setting somewhere (e.g. max-width).

Either way, you'll have to analyze the images, and look into any CSS settings, e.g. using Firebug's "Inspect element" feature (right-click on the image with Firebug installed). That will give you all CSS rules that are applied to the element.

Pekka
<img height="19" width="4" alt="" src="/components/com_mediaonline/uploads/uploads/174/thumb/image_383.jpg" style="border: 2px solid rgb(204, 204, 204);" smartload="12"> this is what it shows in firebug but the actual size is 100x80pxnothing in css setting
Rahul TS
@Rahul where does the height and width info come from? It's not showing up in your PHP code. Are you using any additional Javascript libraries? That "smartload" attribute sounds like that.
Pekka
I am doing it in one of joomla CMS using a new rockettheme template...may be the smartload coming from that.. I not give the width and height its shown the firebug html -----I some what managed to get this to work - with getimagesize() i take the dimension and give it to the code.. not it seems to be working perfect -----THANKS to take your time for me..
Rahul TS
A: 

Reason: You are using Joomla and it automatically creates thumbnails (small image preview) of images in thumbs folder. Your code is displaying these photos instead of original images. This thumb folder of current folder holds the thumbnails for its parent directory.

Solution: So, your second code line should be like this (replace the "/thumbs/" with "/"):

<?php $image_path = "components/com_mediaonline/uploads/uploads/" . $row["photo_id"] . "/" . $row["filename"]; ?>
shamittomar
sorry.. its not the thumb produced by joomla.. Its the path in my component which i have made to do another fucntionality to the cms..so i think nothing to do with removing thumb
Rahul TS