Welcome, Guest
Username: Password: Remember me

TOPIC: Scaling of pictures

Scaling of pictures 2 years 8 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 2 years 8 months ago #7131

  • Super User
  • Super User's Avatar
  • Offline
  • Administrator
  • Posts: 3004
  • Thank you received: 350
  • 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 2 years 4 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.188 seconds

Contact us

  No.2/A, Venkateshwara Nagar,
1st Main Road, 100 Feet Road, SBM Towers, Velachery,Chennai - 600 042,India.
 admin@jomclassifieds.com
 skype.jomclassifieds
 
 
Copyright © 2013-2019 Jomclassifieds.com. All rights reserved. The Joomla! name, and logo are used under a limited license granted in the United States and other countries.