OpenGL is used for rendering because `cairo_rectangle` and
`cairo_pattern_t` had performance problems on zoomed and rotated images.
The size and contrast of the chequered pattern is also reduces to match
other image viewers and editors.
Closes#253
This changes make it more portable by removing bash dependency and not
using GNU-specific 'sort' syntax. Also this fixes issue with selected
image not being displayed first.
The current implementation of freeimage backend automatically rotates the
images based on EXIF info. Libjpeg backed doesn't do that (although libjpeg
itself may be able to, I didn't check). This commit makes Imv use freeimage for
jpeg files when both backends are available to enable automatic image rotation
when possible.
A cleaner solution could be to add automatic rotaiton functionality to libjpeg
backend as well, but this quick hack is better than nothing ☺
This seems to have a better behavior, this way, the fonts in Imv seem to have
the same size as the fonts in other programs (Sway, Waybar) when configured in
the same way.
Before this commit, the code in src/wl_window.c seemed to handle the Wayland
scaling [1] correctly, it was sending resize events to imv to update the buffer
size accordingly. One thing it didn't update is the scaling of fonts that Pango
renders on Cairo.
This commit simply forwards the scaling factor (computed as [1] requests)
together with updated buffer dimentions in resize event, and when the resize
event is handled it calls cairo_surface_set_device_scale to notify Pango/Cairo
of the scaling.
For X11, I simply assume the scaline factor is always 1. This seems to be what
the old code did: `grep scale src/x11_window.c` gives no matches. AFAIK, X11
does not have an established way of telling clients what scaling factor to use
(and never updates it at runtime).
[1]: https://wayland-book.com/surfaces-in-depth/hidpi.html
This includes the commands available in contrib/. It's enabled by
default.
I moved the manpage and desktop file to their regular locations to avoid
complicating the meson file too much. They won't be installed when you
disable the contrib commands.
`imv` now supports HEIC, but other applications (e.g.: file managers) cannot determine this, since it's not listed as a supported mime type.
Adding this entry allows such applications to determine that `imv` can handle HEIC files.
* inih is now widely available as a system library
* if not, a fallback from Wrap DB can be used
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
This issue was spotted on musl, where killing imv with the Q shortcut
while it was waiting for image paths in stdin led to the application
hanging until stdin received an EOF manually with ^D, since the stdin
stream was locked by the fgets() function.
Switching to pipes and a helper thread allows us to use read() for
reading from STDIN_FILENO while still taking advantage of the fgets()
logic for handling newlines and buffer size. read() is a thread
cancellation point (fgets() is only an optional one), which makes it
possible to cancel the helper thread cleanly and force the thread using
fgets() to exit when the write-end of the pipe it's reading from is
closed.
Since this isn't essential functionality, it's ok to simply not provide
it. In cases where XDG_RUNTIME_DIR was empty (but not unset) or set to a
directory where the user didn't have write permissions, socket creation
would fail and lead to segmentation faults in imv, due to the return
value of imv_ipc_create() not being checked.
Add newline to the prompt for reading paths from stdin.
Since string formatting isn't being used, it's possible to use fputs()
directly in the logging callback in imv.c.
split color_rgba into color_rgb and alpha
added configuration options to man pages
cleanup gitignore: the man pages output is now in the build directory,
so there is no to ignore man pages individually
* first steps for colored overlay
* overlay color wip
* add option for overlay position
if overlay_positiion_bottom is true overlay is at the bottom
* remove enum for overlay position