# Rotating an Image in Image Viewer

**URL:** https://resource.dopus.com/t/rotating-an-image-in-image-viewer/27610
**Category:** Help & Support
**Created:** [December 22, 2017, 6:12am UTC](https://resource.dopus.com/t/rotating-an-image-in-image-viewer/27610 "2017-12-22T06:12:39Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)
#### Post date: [December 22, 2017, 8:41am UTC](https://resource.dopus.com/t/rotating-an-image-in-image-viewer/27610/2 "2017-12-22T08:41:41Z")

</div>

Rotating in the viewer isn't seen as modifying the image. It's the same as zooming in or out, and only changes how the image is displayed on screen.

You can add a command to the viewer which rotates the file on disk, then tells the viewer to reload the file:

```nohighlight
Image ROTATE=90 HERE REPLACE QUALITY=100
Show VIEWERCMD=refresh

```

Note that JPEGs can only be losslessly rotated in some situations (width and height need to be a multiple of 8) so each rotation of the file data may degrade the image quality of a JPEG file. So you might want to have buttons for 90, 180 and 270 rotations instead of repeatedly applying a 90 rotation to the same file.

It would also be possible to add a command which does a forced save of the viewer's in-memory bitmap over the file it was loaded from, but that would _always_ degrade image quality with JPEG files, even in situations where the file could have been rotated losslessly.

Using Opus's image converter (or Image command, to automate things) from outside of the viewer is another way to rotate image files. (If you use the image converter from inside the viewer, via the File menu, note that it works on and re-saves the image data in memory, so it can't do lossless rotations via that route.)

---

_[View the full topic](https://resource.dopus.com/t/rotating-an-image-in-image-viewer/27610)._
