Need pixbuf orientation available on GdkPixbufLoader "size-prepared" signal
Submitted by Marina Zhurakhinskaya
It would be useful to make pixbuf orientation available by the time GdkPixbufLoader "size-prepared" signal is emitted, so that the scaled size for the pixbuf can be determined correctly given the available width and height.
It is currently not available from the pixbuf returned by gdk_pixbuf_loader_get_pixbuf() at that time of the signal or from any function of the GdkPixbufLoader itself.
The workaround I am using now is loading a scaled image with the default orientation, then calling gdk_pixbuf_apply_embedded_orientation() for it, checking if the width of the pixbuf returned by that function is different from the width of the original pixbuf, and if it is, reloading the scaled image with the available dimensions reversed, and calling gdk_pixbuf_apply_embedded_orientation() on it.
There are a few possibilities, including making related functions available for the pixbuf returned by the GdkPixbufLoader at the time or having the GdkPixbufLoader itself have a function to get or apply embedded orientation before the pixbuf is actually loaded. Since getting embedded orientation can return multiple values the same way "orientation" option for gdk_pixbuf_get_option() returns multiple values, it might be useful to just have a function that returns a boolean indicating if rotation will be necessary when embedded orientation is applied.
Version: git master