Welcome, Guest
Username: Password: Remember me

TOPIC: supprime "size=100x50&"

supprime "size=100x50&" 09 Dec 2013 20:15 #11794

  • LJ01
  • LJ01's Avatar
  • Offline
  • Senior Member
  • Posts: 78
  • Thank you received: 2
  • Karma: 0
Hi
to display image in the grid
src="/index.php?option=com_batenergie&task=file&size=100x50&path=[DIR_BATENERGIE_IMAGE]stade_clermont.jpg"
where this code are generated, because i want to supprime "size=100x50&"
thanks
LJ
Ce sont les fils qui font les cordes
ingall-niger.org
The administrator has disabled public write access.

supprime "size=100x50&" 11 Dec 2013 21:45 #11797

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
What do you mean ?

You want still to resize it, but without the url param ?

Well this URL might be generated by JDom
Then, the component helper catch it and output the resized thumb thanks to the classes/file.php class

Do you want to access directly or indirectly ?
Coding is now a piece of cake
The administrator has disabled public write access.

supprime "size=100x50&" 12 Dec 2013 15:06 #11798

  • LJ01
  • LJ01's Avatar
  • Offline
  • Senior Member
  • Posts: 78
  • Thank you received: 2
  • Karma: 0
Hi
i want to delete it, because in a view this code prevents the display of the image ...
LJ
Ce sont les fils qui font les cordes
ingall-niger.org
The administrator has disabled public write access.

supprime "size=100x50&" 12 Dec 2013 15:08 #11799

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
I don't understand what you want to remove ?
Please be more specific.
Coding is now a piece of cake
The administrator has disabled public write access.

supprime "size=100x50&" 12 Dec 2013 19:35 #11800

  • LJ01
  • LJ01's Avatar
  • Offline
  • Senior Member
  • Posts: 78
  • Thank you received: 2
  • Karma: 0
delete &size=100x50 in the url
Ce sont les fils qui font les cordes
ingall-niger.org
The administrator has disabled public write access.

supprime "size=100x50&" 12 Dec 2013 19:42 #11801

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
If you look at you file class, you can see this function.
You can redefine you image thumb size there.
public static function returnFile($mode = null)
{
	$jinput = JFactory::getApplication()->input;
	$path = $jinput->get('path', null, 'STRING');
	$size = $jinput->get('size', null, 'CMD');
	$action = $jinput->get('action', null, 'CMD');
	$attrs = $jinput->get('attrs', null, 'STRING');

	$filePath = null;
	if (!$path)
	{
		// Read through database index
		$view = $jinput->get('view', null, 'CMD');
		$key = $jinput->get('key', null, 'CMD');
		$cid = $jinput->get('cid', null, 'INT');

		if ($view && $key && $cid)
			$path = self::getFromIndex($view, $key, $cid);

		//Fallback
		if (!$path)
			$filePath = DEMO120_IMAGES_FALLBACK_ROOT .DS. DEMO120_IMAGES_FALLBACK_NAME;
	}

	$options = null;
	if (!$filePath && $path)
		$filePath = self::getPhysical($path, $options);


	$ext = self::getExt($filePath);



	jimport('joomla.filesystem.file');

	$imagesExt = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
	$mime = null;
	if ($action == 'download')
		$mime = 'application/force-download';  // OU    application/octet-stream
	else if (self::exists($filePath))
		$mime = self::getMime($filePath);


	//Is image ?
	if (($action != 'download') &&
	(in_array($ext, $imagesExt)		//Check on extension
	|| ($mime && preg_match("/^image/", $mime)))			//Check on mime
	)
	{
		require_once(JPATH_ADMIN_DEMO120 .DS. 'classes' .DS. 'images.php');
		$thumb = new Demo120Images($filePath, $mime);

		if ($attrs)
			$thumb->attrs($attrs);


		if ($size && preg_match("/([0-9]+)x([0-9]+)/", $size, $matches))
		{
			$thumb->width($matches[1]);
			$thumb->height($matches[2]);;
		}

		$thumb->get();

		exit();
	}
	else if (!JFile::exists($filePath))
	{
		$app = JFactory::getApplication();
		$msg = JText::sprintf( "DEMO120_UPLOAD_FILE_NOT_FOUND", $path);
		$app->enqueueMessage($msg, 'error');

		jexit();
	}

	//Non image and non outputable mimes : Force download
	if (!in_array($mime, array(
							'application/x-shockwave-flash'
						)))
	{
		header('Content-Description: File Transfer');
	    header("Content-Disposition: attachment; filename=\"".basename($filePath) . "\"");
	}

	//Read and return file contents with original mime header
	header('Content-Type: ' . $mime);
	header('Content-Transfer-Encoding: binary');
	header('Expires: 0');
	header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
	header('Pragma: public');
	header('Content-Length: ' . filesize($filePath));
	ob_clean();
	flush();

	readfile($filePath);

	jexit();
}

EDIT :


Here
classes/file/file.php
Coding is now a piece of cake
Last Edit: 12 Dec 2013 19:44 by admin.
The administrator has disabled public write access.

supprime "size=100x50&" 13 Dec 2013 11:42 #11802

  • LJ01
  • LJ01's Avatar
  • Offline
  • Senior Member
  • Posts: 78
  • Thank you received: 2
  • Karma: 0
ok understand
now it's another problem deconnected the first
my miniatures aren't created with her extension -100x50.jpg when i load a image
i must create this manually ...
where look ?
LJ
Ce sont les fils qui font les cordes
ingall-niger.org
The administrator has disabled public write access.
Time to create page: 0.095 seconds

Get Started