imagine-svg icon indicating copy to clipboard operation
imagine-svg copied to clipboard

How to use flipHorizontally method in this library

Open rashidaghadiinfotech opened this issue 2 years ago • 4 comments

Hello there,

Anyone knows how to use flipHorizontally() method in this library. I referred this docs https://imagine.readthedocs.io/en/stable/index.html but didn't found anything to flip the SVG image.

I simply want to flip the image

$imagine = new Imagine();
  $image = $imagine->open($svg_file);
  $image->resize(new Box($determine_width, $determine_height));
  
  $color_code = $option_list['sic_color_code'] ? $option_list['sic_color_code'] : '#000000';
  $image->effects()->colorize($image->palette()->color($color_code));
  
  $image->flipHorizontally();
  
  $image->save($file_path);

Error is : Uncaught Imagine\Exception\NotSupportedException: This method is not implemented in.........

Any idea what I am missing here?

@ausi you helped me on colorize stuff earlier and it was a great method. Can you please help me here too? Your help will be highly appreciated.

Update: I also used following code but same error

$transformation = new Transformation();
$transformation->flipVertically();
$transformation->apply( $imagine->open($file_path) )->save($file_path_2);

rashidaghadiinfotech avatar Dec 06 '22 05:12 rashidaghadiinfotech