Age | Commit message (Collapse) | Author |
|
This prevents imv from trying to "catch up" on the time that it was
asleep for by playing the gif back at high speed.
|
|
From read(2) manual page on OpenBSD:
Error checks should explicitly test for -1. Code such as
while ((nr = read(fd, buf, sizeof(buf))) > 0)
is not maximally portable, as some platforms allow for nbytes to range
between SSIZE_MAX and SIZE_MAX - 2, in which case the return value of an
error-free read() may appear as a negative number distinct from -1.
Proper loops should use
while ((nr = read(fd, buf, sizeof(buf))) != -1 && nr != 0)
Distingushing between error and eof would also help for debugging.
|
|
|
|
|
|
|
|
Fix the linking order of tests in the Makefile for --as-needed
|
|
When '--as-needed' linker flag is added to LDFLAGS, linker strips out
the symbols from the libraries needed for the tests due to the order
in which the libraries appear on the command line. List the source
files before the libraries to fix the linking issue.
For more information, see:
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Importance_of_linking_order
Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>
|
|
|
|
Previously imv used -std=gnu11 flag which activated GNU "extensions" of C11
standard. This masked a portability issue in imv: strduo(3) should not have
been visible in `src/loader.c` without inclusion of `<string.h>` header. This
have been fixed. To remidy GNU libc's stange choice to hide X/Open interfaces
in C99 code by default _XOPEN_SOURCE macro was also set. (This should have no
effect on most other platforms.)
|
|
This reverts commit 9e3db8bdaad7d7752b24df5d9832b980a21f4496. The effort was
futile.
|
|
This way we may continue using strict flags for detecting issues while still
allowing old compiler versions elsewhere.
|
|
|
|
|
|
In case of error return non-zero value instead of cleaning up navigator. This
way main loop may do some more cleanup, or maybe even act differently.
|
|
Implementation details should not leak to other parts of the code.
While at it, clean up initialization and destruction of navigator.
|
|
Set "last_time" to current time at declaration time, so that it holds at least
something by the time it is used.
|
|
|
|
This allows to drop extra printing steps and memory allocations.
|
|
|
|
This change effectively backs out f1737ddd06141afbe99f37af3b5c2d0f1df5fe7a,
implementing the same functionality in a simpler and more correct way.
Implementation details:
* imv_navigator.wrapped - a new field that has value "0" by default; once
navigator wraps around the list, this field recieves value "1".
* imv_navigator_wrapped(&nav) - a new function that returns non-zero value iff
navigator wrapped around the list. Currently just returns value of
imv_navigator.wrapped.
While at it, expanded "test_navigator_remove" and merged it with
"test_navigator_add". Resulting test is called "test_navigator_add_remove".
Fixes #94.
|
|
When non-cycling mode prevents navigator from wrapping to the other end of list,
undo change to nav->cur_path. Otherwise it will remain out-of-bounds, so that
subsequent calls to navigator functions may produce unexpected results, up to
segmentation violation.
Fixes #93
|
|
Test that removing items leads to predictable results. Right now test is fairly
incomplete, because it does not cover moving in reversed direction.
|
|
Apparently bg_next_frame() functions marked first frames of gifs old before
imv_loader_get_image() had a chance to report them to the main loop. Move
unsetting of ldr->out_is_new_image to imv_loader_get_image().
Fixes #81.
|
|
|
|
|
|
For the following actions:
* reset scaling ('s'),
* redraw ('r'),
* scale to actual size ('a'),
* center image ('c'),
* remove selection ('x'),
* toggle fullscreen ('f'),
* toggle playing (space),
* print selection ('p'),
* toggle overlay ('d')
repeating action when key is held does not make sense. After acting upon these
events ignore them until key is released or another key is pressed.
|
|
When operating in git repo, build system will include abbreviated git hash in
imv version number. If there is no git repo around (eg. building from tarball),
fall back to version number in Makefile.
Fixes #90
|
|
Make '+' work on all layouts
|
|
Key handling code obuses the fact that plus sign is shifted key for equals sign
on US keyboard. Add '+' as a control for layouts where this is not the case.
|
|
fixed comment typo in loader.h
|
|
|
|
Add -x switch to exit imv when reaching end of file list.
|
|
|
|
Read file list from standard input continuosly
|
|
|
|
|
|
This reduces delay before initial draw in case of slow input, opening
possibilities for use cases like:
$ curl -Osw "%{filename_effective}\n" "http://www.example.com/[1-10].jpg"
which will download all images and start showing them once first arrives.
|
|
Use Exif rotation for JPEG images
|
|
|
|
|
|
|
|
for i in "..."; do ...; done ideom guarantees single iteration with $i set to
everything between "in" and ';'.
|
|
|
|
|
|
|
|
If the gif disposal method is unspecified, default to compositing
instead of full disposal.
|
|
|
|
|
|
Add third scaling mode: best fit
|
|
* Add new switches: "-S" to force (default) "perfect fit" mode and "-s" to force
"best fit" mode.
* Add new control key: "s" to switch scaling mode.
|