ImageViewer used two different logic to resize the display window, which
leads to confusing behaviour for rotate function. Now all the resizing
behaviour goes through the existing resize_window function.
By using the real path for the image, ImageViewer can iterate over the
images in the same directory. Before, this was not possible when
ImageViewer opened from Terminal with a path argument.
Previously deleting an animated image wouldn't make the animation timer
stop. This resulted in the animation still running in the ViewWidget.
Moreover the timer wasn't stopped when loading different images, which
led to high CPU usage when going from an animated image to a
non-animated one.
Previously some actions like Rotate/Flip/Set as Desktop Wallpaper would
make the application crash if no image was loaded. Now image actions are
enabled/disabled based on whether an image has been loaded or not.
Instead of parsing untrusted and potentially malicious image files in
the ImageViewer GUI process, take advantage of the ImageDecoder service
that we already have on the system to sandbox the decode.
This prevents bugs in our image decoding libraries from being used as
an exploitation vector when viewing files in ImageViewer.