Welcome, Guest
Username: Password: Remember me

TOPIC: Scaling of pictures

Scaling of pictures 1 year 11 months ago #7129

  • Roland Verhaar
  • Roland Verhaar's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 3
  • Karma: 1
When users upload their pictures, the pictures can be big.
The max. size is never shown, and it is not really needed to store there large files in the media folder.
Can I add some code to scale pictures to a maximum size, before it is stored in the media folder?
Where do I add such code?
The administrator has disabled public write access.

Scaling of pictures 1 year 10 months ago #7131

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 2972
  • Thank you received: 344
  • Karma: 46
Sorry, currently this feature is not available. If you need it, please contact our customization team at This email address is being protected from spambots. You need JavaScript enabled to view it. .

Thanks.
The administrator has disabled public write access.

Scaling of pictures 1 year 7 months ago #7304

  • Roland Verhaar
  • Roland Verhaar's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 3
  • Karma: 1
I have altered my code;
In /administrator/components/com_jomclassifieds/etc/uploader.php
the following code in the function
doUpload($file, $dir, $config)
...
} else {
	self::doProcess($jomclUpload, '_list', $config->listthumbwid, $config->listthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_grid', $config->gridthumbwid, $config->gridthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_gallery', $config->detgalleryimgwid, $config->detgalleryimghei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_popup', $config->popupimgwid, $config->popupimghei, $config->resizemethod, $uploadDir);
	}
....
Changed this to:
...
} else {
	self::doProcess($jomclUpload, '_list', $config->listthumbwid, $config->listthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_grid', $config->gridthumbwid, $config->gridthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_gallery', $config->detgalleryimgwid, $config->detgalleryimghei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_popup', $config->popupimgwid, $config->popupimghei, $config->resizemethod, $uploadDir);
	// Resize the original image to 1024 x 768 to reserve diskspace
	self::doProcess($jomclUpload, '', 1024, 768, $config->resizemethod, $uploadDir);			
	}
...
And in the function
doRecreateImages($file, $dir, $config)
....
} else {
	self::doProcess($jomclUpload, '_list', $config->listthumbwid, $config->listthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_grid', $config->gridthumbwid, $config->gridthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_gallery', $config->detgalleryimgwid, $config->detgalleryimghei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_popup', $config->popupimgwid, $config->popupimghei, $config->resizemethod, $uploadDir);
}
...	
Change this to:
....
} else {
	self::doProcess($jomclUpload, '_list', $config->listthumbwid, $config->listthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_grid', $config->gridthumbwid, $config->gridthumbhei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_gallery', $config->detgalleryimgwid, $config->detgalleryimghei, $config->resizemethod, $uploadDir);
	self::doProcess($jomclUpload, '_popup', $config->popupimgwid, $config->popupimghei, $config->resizemethod, $uploadDir);
	// Resize the original image to 1024 x 768 to reserve diskspace
	self::doProcess($jomclUpload, '', 1024, 768, $config->resizemethod, $uploadDir);
	}
...
I know that the size is 'hard-coded' at this moment. With some additional code and extensions of the XML file(s) this is easily altered to use a configurable resize.
Maybe the development team can work with this code and integrate something.
The administrator has disabled public write access.
The following user(s) said Thank You: Stephen Höglund, parazok, Luis Sosa
Time to create page: 0.132 seconds

We accept cookies to provide you the best viewing experience. By using our services, you agree to our use of cookies