I am trying to invert an image in svg. I came across this thread but this solution works for images placed at the origin (0,0).
If the width of the image is 100 and the image is at (0,0), then I do the following
img.setAttributeNS(null, 'transform', 'translate(100,0) scale(-1,1)');
I tried to flip/invert an image placed at (x,y) but the image disappears. I am not clear as to what translation I should use.
The fiddle is here If you uncomment the lines to set the attributes (x,y) for the image, the image disappears.
I want to understand how the scale function exactly works and what I am doing wrong here.