× Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues

cropResize

6 anos 7 meses atrás - 6 anos 7 meses atrás #1776 por Eric Fagault
cropResize foi criado por Eric Fagault
Hello,
I need to resize and crop an image.
I looked at your documentation "www.component-creator.com/joomladocs/joo...mage/cropResize.html"

I built my code like this:
<?php
				$ImageWidth = 250; [attachment=88]Capture_cropSize.JPG[/attachment] [attachment=88]Capture_cropSize.JPG[/attachment]
				$ImageHeight = 180;
				
				//Chemin de la photo à retailler
				$uploadPath = '/media/com_esoffers/images/photos_annonce' . DIRECTORY_SEPARATOR . $PhotoPrincipale;
																	
				//cropResize
                                // TEST 1
				/*
				$image = new JImage($uploadPath);	
				$newimage = $image->cropResize('250', '180');		
				$newimage->toFile('/media/com_esoffers/images/photos_annonce/annonces1'.$idOffers.'.jpg');
				*/
				
                                // TEST 2
				$image = new JImage($uploadPath);	
				$newimage = $image->cropResize($ImageWidth, $ImageHeight);		
				$newimage->toFile('/media/com_esoffers/images/photos_annonce/annonces1'.$idOffers.'.jpg');

 	?>
                                <img src="/media/com_esoffers/images/photos_annonce/annonces1<?php echo $idOffers; ?>.jpg" alt="" title="Voir l'annonce"/>
						<!-- For display test -->
						<img src="<?php echo $uploadPath; ?>"/>

But it sends me an error, which tells me that the image does not exist.
Yet it looks good when I do:
<img src = "<? php echo $ uploadPath;?>" />

How would you do it??

Best regards.

Eric
Anexos:
Ultima edição: 6 anos 7 meses atrás por Eric Fagault.

Por favor Acessar ou Registrar para participar da conversa.

6 anos 6 meses atrás #1798 por Jamila
Respondido por Jamila no tópico cropResize
Hi Eric,

thank you for pointing that out. The documentation you found is outdated. Here you can find the Joomla! Documentation for Joomla! 3.8: api.joomla.org/cms-3/classes/Joomla.Imag...age.html#method_crop

We will update the documentation on our website as soon as possible.

Best regards,
Jamila Cisse

Por favor Acessar ou Registrar para participar da conversa.

6 anos 2 meses atrás #1827 por Pieter-Jan van Rossen
Respondido por Pieter-Jan van Rossen no tópico cropResize

Hi Eric,

thank you for pointing that out. The documentation you found is outdated. Here you can find the Joomla! Documentation for Joomla! 3.8: api.joomla.org/cms-3/classes/Joomla.Imag...ge.html#method_crope


Keep in mind that this is also depricated

Por favor Acessar ou Registrar para participar da conversa.

Tempo para a criação da página:0.052 segundos
Powered by Fórum Kunena

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.