Calc to image thumbs

jh

Member
Hi

Ive been using a calc to return an image for a list from another list, this is all working fine. However I realised it should really be linking to the thumbnail image that is created.

Using the code I currently have it returns the path eg:

/images/item/**.jpg

But I want it to return eg:
/images/item/thumbs/**.jpg

Note that I was using inline styling eg style="height:123px" but this is not how to reduce load times I guess.
Tested fine in firebug but I dont know how to change the path to the thumbs folder, as I guess the element is only returning the main image uploaded?

Thank you in advance for any assistance.

Kind Regards
 
I don't know if you can access path and filename separately. But in any case you can do some string handling, replacing e.g. /item with /item/thumbs

Gesendet von meinem SM-G930F mit Tapatalk
 
Correct, the upload element only stores the main file path, you'd have to create the thumb path yourself. Either by replacing as per Troester's suggestion, or something like this, assuming $filePath contains '/images/item/foo.jpg' ...

Code:
$thumbPath = '/images/item/thumbs/' . basename($filePath);

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top