Welcome, Guest
Username Password: Remember me

Prevent image resize on one image?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Prevent image resize on one image?

Prevent image resize on one image? 11 years, 3 months ago #13528

  • lunky84
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
Is it possible to stop image resize on only one image, maybe by adding a class to the image for example?

I have used an image on the homepage of my site that I don't want to resize. Due to the way the site is designed the image has to be in the HTML and cannot be a background CSS image.

I've also tried replacing the auto generated resized file with the original and updating the name but the file simply gets regenerated and overwrites it.

Re: Prevent image resize on one image? 11 years, 3 months ago #13532

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4866
  • Karma: 105
It's not implemented because of there was no such requests previously. But actually it can be easily done with simple patch. In your case you could edit administrator/components/com_mobilejoomla/classes/imagerescaler.php and add a check in imageParsing function, smth like

 
static function imageParsing($matches)
{
$text = $matches[1];
/* patch */ if (strpos($text, 'class="no-rescale"') !== false) return "<img$text/>";
 
The following user(s) said Thank You: eclipsemedia

Re: Prevent image resize on one image? 11 years, 3 months ago #13597

  • lunky84
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
Brilliant thanks for this, it will be very useful!
Last Edit: 11 years, 3 months ago by lunky84.
  • Page:
  • 1
Time to create page: 0.10 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.