Is there a way to modify the size of the image when using the image_embed function?


  • Default avatar
    bryan4    
     11 years ago
    0

    I need to get this done asap and I posted a different possible solution to my issue earlier with no response. Im assuming thats because its easier said than done. I need to be able to adjust the size of the cetificate sent via email without having to go in and change all of the templates and settings.

    Just to have the email send the image with a set size even if it reduced via html. I need the coupon to 700 pixels wide max. his should print ok. Please tell me how I can do this and where to find the php file that controls the settings of the emails.

    Bryan
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    To resize, you would need something like imagecopyresampled function:
    http://php.net/manual/en/function.imagecopyresampled.php

    The file you want to modify is
    www/administrator/components/com_awocoupon/assets/virtuemart/ps_awo_giftcert.php, function writeToImage,
    within the if statement

    <?php
            
    elseif($output=='email') {
    ?>
  • Default avatar
    bryan4    
     11 years ago
    0

    I looked at both solutions in both threads and they both seem very similar. This is good because I will try both to see which will work best. The problem is that this has taken me above my abilities in php as I have no idea how to work with if statements. Can you please just give me an example or even better, actually insert the code into ps_awo_giftcert.php for me so I can modify the sizes. you can email the files to me or post them here. I would be willing to pay you if necessary.

    Bryan

  • Default avatar
    bryan4    
     11 years ago
    0

    Please Seyi,

    This is very time sensitive. I need your help as soon as possible.

    Bryan
  • Your avatar
    seyi    
     11 years ago
    0

    Hi,

    You could have literally copied the example:

    <?php
            
    elseif($output=='email') {
               
    width imagesx($im)
               
    height imagesy($im);
               
    $percent 0.70;
                
               
    imagecopyresampled($im$im0000$width*$percent$height*percent$width$height);
    ?>