I've had similar issue I've worked on today, and top comment did help a lot to get started.
How ever,
In my scenario I'm uploading pictures that will be added to generated pdf upon export.
I do allow users to rotate them in front end, and save the values of rotation (i.e. 0, 90, 180, 270) with the picture it self.
.ctp file used for generation of the file contained something along the lines of
echo '<img class="image" src="'.h($imageSrcPath).'" alt="" />';
So to rotate I've created classes as following:
img.rotate_0 {
-webkit-transform: rotate(0deg);
-webkit-transform-origin: center center;
}
img.rotate_270 {
-webkit-transform: translateX(-100%) rotate(-90deg);
-webkit-transform-origin: top right;
}
img.rotate_180 {
-webkit-transform: rotate(180deg);
-webkit-transform-origin: center center;
}
img.rotate_90 {
-webkit-transform: translateX(-100%) rotate(270deg);
-webkit-transform-origin: top right;
}
and changed .ctp file to
echo '<img class="rotate_'.h($rotation).'" src="' . h($imageSrcPath) . '" alt="" style="margin-top:15px;")/>';
Seeing as different degrees of rotation need me to have ever so slightly different transform-origin