Image resize script recommendation

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
zorro128
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 192
Joined: Tue Sep 27, 2005 7:27 am
Contact:

Image resize script recommendation

Post by zorro128 » Fri Oct 22, 2021 3:14 am

What image resize script do you use?

I have been using TimThumb for years. Never had issues with it, although it is not maintained anymore.

So I am looking for good and simple replacement.

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 7246
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Image resize script recommendation

Post by AMurray » Fri Oct 22, 2021 8:46 am

I don't use any. I re-size the images before uploading.

For bulk processing like that try irfanview, a desktop application to optimise and/or resize your images.
Regards - A Murray

zorro128
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 192
Joined: Tue Sep 27, 2005 7:27 am
Contact:

Re: Image resize script recommendation

Post by zorro128 » Fri Oct 22, 2021 9:50 am

I am using Irfanview from it's begining :D

To be more precise aboute image resize script.

I upload only one image with size 1024x577 (16:9 ratio). I use this image in desktop, tablet or mobile view.

When using TimThumb I was resizing images on fly for each view. Bigger sized images for desktop and smaller sized for tablet and mobile.

Full sized image is used in article view. Resized images are used when displaying articles in modules or in category (blog) view.

Live example can be seen at www.dev.livno-online.com.

User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 7246
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Image resize script recommendation

Post by AMurray » Fri Oct 22, 2021 10:27 pm

Something like this perhaps may help you: https://extensions.joomla.org/extension ... ge-resize/ ???

It's probably good that you're moving on from "Tim Thumb" because all the google searches I've done for it reference its vulnerabilities in that it allows remote upload of malicious files. Can't find any reference to this plugin for Joomla, only Wordpress.
Regards - A Murray

zorro128
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 192
Joined: Tue Sep 27, 2005 7:27 am
Contact:

Re: Image resize script recommendation

Post by zorro128 » Fri Oct 22, 2021 11:31 pm

I have used TimThumb without plugin.

I just called script in module/template like this:

Code: Select all

<img src="https://www.mysite.com/templates/mytemplate/resize.php?src=https://www.mysite.com/images/image.jpg&amp;h=163&amp;w=290" alt="" />
Perhapse I should go with picture tag. Something like this:

Code: Select all

<picture data-alt="" data-default-src="/media/img/7b/df/95a17dd6ee90fda304e7.jpeg">

        
 <source srcset="/media/img/7b/df/95a17dd6ee90fda304e7.jpeg" media="(min-width: 1024px)" data-size="960x540" />
        
            <source srcset="/media/img/f0/a2/51b90832f67e3e8895ec.jpeg" data-size="612x408" />
        

        <img class="" src="/media/img/f0/a2/51b90832f67e3e8895ec.jpeg" alt="" data-size="612x408" />

        <noscript>
            <img class="" src="/media/img/7b/df/95a17dd6ee90fda304e7.jpeg" alt="" />
        </noscript>
    </picture>

zorro128
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 192
Joined: Tue Sep 27, 2005 7:27 am
Contact:

Re: Image resize script recommendation

Post by zorro128 » Sun Oct 24, 2021 4:42 pm

I have implemented srcset solution.

I have defined 4 image sizes (width): 1024 px, 720 px, 520 px and 320 px.

Hope I did it okay. This is the first time I have used this solution

Code: Select all

<img srcset="<?php echo JUri::base().$item->imageSrc; ?> 1024w,
				 <?php echo JUri::base().preg_replace('/_1024/', '_720', $item->imageSrc); ?> 720w,
				 <?php echo JUri::base().preg_replace('/_1024/', '_520', $item->imageSrc); ?> 520w"
		 sizes="(max-width: 576px) 520px,
				(max-width: 992px) 720px,
				1024px"
		 src="<?php echo JUri::base().$item->imageSrc; ?>"
		 class="img-fluid lazyload"
		 alt="<?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?>"
		 width="1024" height="577"
		 >

User avatar
brian
Joomla! Master
Joomla! Master
Posts: 12314
Joined: Fri Aug 12, 2005 7:19 am
Location: Leeds, UK
Contact:

Re: Image resize script recommendation

Post by brian » Sun Oct 24, 2021 5:12 pm

wow - havent heard of timthumb for years. Possibly the most insecure php script ever and responsible for countless hacked web sites
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/


Post Reply

Return to “Templates for Joomla! 3.x”