summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog26
-rw-r--r--Makefile17
-rw-r--r--README.md6
-rw-r--r--cam/ChangeLog14
-rw-r--r--cam/README45
-rw-r--r--cam/cam_bookmarks2
-rwxr-xr-xcam/feh-cam195
-rwxr-xr-xcam/gen-cam-menu44
-rw-r--r--config.mk1
-rw-r--r--man/feh-cam.pre57
-rw-r--r--man/feh.pre76
-rw-r--r--man/gen-cam-menu.pre33
-rw-r--r--src/Makefile1
-rw-r--r--src/collage.c208
-rw-r--r--src/feh.h1
-rw-r--r--src/filelist.c7
-rw-r--r--src/gib_imlib.c12
-rw-r--r--src/gib_imlib.h2
-rw-r--r--src/gib_list.c2
-rw-r--r--src/help.raw7
-rw-r--r--src/imlib.c14
-rw-r--r--src/keyevents.c2
-rw-r--r--src/main.c4
-rw-r--r--src/options.c32
-rw-r--r--src/options.h9
-rw-r--r--src/slideshow.c19
-rw-r--r--src/wallpaper.c2
-rw-r--r--src/winwidget.c2
-rwxr-xr-xtest/mandoc.t2
-rw-r--r--test/status2
30 files changed, 177 insertions, 667 deletions
diff --git a/ChangeLog b/ChangeLog
index 901afc0..33d21de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+git HEAD
+
+ * Remove deprecated webcam scripts (feh-cam and gen-cam-menu)
+
+Sat, 27 Oct 2018 19:46:48 +0200 Daniel Friesel <derf+feh@finalrewind.org>
+
+* Release v2.28.1
+ * Do not ignore quit signals (SIGTERM, SIGINT, SIGQUIT) during preload
+ * Add missing EXIF orientations 2, 4, 5, and 7 (when built with exif=1,
+ patch by Olof-Joachim Frahm)
+ * Improve randomness on non-glibc systems
+
+Mon, 17 Sep 2018 21:17:04 +0200 Daniel Friesel <derf+feh@finalrewind.org>
+
+* Release v2.28
+ * Decrease loading time for RAW images by utilizing dcraw to display the
+ embedded JPEG preview (patch by <https://github.com/ulteq>)
+ * Rename --magick-timeout to --conversion-timeout. --magick-timeout is
+ now deprecated and will be removed in a future release
+ * Fix unintened aliasing in rotated images whose rotation is not a
+ multiple of 90 degrees (patch by <https://github.com/ulteq>)
+ * New option: --on-last-slide=hold|quit|resume.
+ hold will cause feh to stop advancing beyond the last slide (patch by
+ <https://github.com/ulteq>), quit replaces --cycle-once (which is now
+ deprecated), and resume is the default (continue at the first image).
+
Tue, 17 Jul 2018 17:33:10 +0200 Daniel Friesel <derf+feh@finalrewind.org>
* Release v2.27.1
diff --git a/Makefile b/Makefile
index 925e3fb..552ae4d 100644
--- a/Makefile
+++ b/Makefile
@@ -25,23 +25,6 @@ test-x11: all
install: install-man install-doc install-bin install-font install-img
install: install-icon install-examples install-applications
-ifeq (${cam},1)
-install: install-cam
-uninstall: uninstall-cam
-endif
-
-install-cam:
- @echo installing fe-cam and gen-cam-menu
- @cp man/feh-cam.1 man/gen-cam-menu.1 ${man_dir}/man1
- @chmod 644 ${man_dir}/man1/feh-cam.1 ${man_dir}/man1/gen-cam-menu.1
- @cp cam/feh-cam cam/gen-cam-menu ${bin_dir}
- @chmod 755 ${bin_dir}/feh-cam ${bin_dir}/gen-cam-menu
-
-uninstall-cam:
- rm -f ${man_dir}/man1/feh-cam.1
- rm -f ${man_dir}/man1/gen-cam-menu.1
- rm -f ${bin_dir}/feh-cam ${bin_dir}/gen-cam-menu
-
install-man:
@echo installing manuals to ${man_dir}
@mkdir -p ${man_dir}/man1
diff --git a/README.md b/README.md
index 334e681..3b33520 100644
--- a/README.md
+++ b/README.md
@@ -78,8 +78,7 @@ Available flags are:
| Flag | Default value | Description |
| :--- | :---: | :--- |
-| app | 0 | install icons to /usr/share, regardless of `DESTDIR` and `PREFIX, and call gtk-update-icon-cache afterwards |
-| cam | 0 | install deprecated feh-cam und gen-cam-menu scripts |
+| app | 0 | install icons to /usr/share, regardless of `DESTDIR` and `PREFIX`, and call gtk-update-icon-cache afterwards |
| curl | 1 | use libcurl to view http:// and similar images |
| debug | 0 | debug build, enables `--debug` |
| exif | 0 | Builtin EXIF tag display support |
@@ -88,7 +87,8 @@ Available flags are:
| verscmp | 1 | Support naturing sorting (`--version-sort`). Requires a GNU-compatible libc exposing `strverscmp` |
| xinerama | 1 | Support Xinerama/XRandR multiscreen setups |
-So, by default **libcurl** and **Xinerama** are enabled, the rest is disabled.
+So, by default **libcurl**, **verscmp**, and **Xinerama** are enabled.
+All other flags are disabled.
Additionally, the standard variables `PREFIX` and `DESTDIR` are supported.
diff --git a/cam/ChangeLog b/cam/ChangeLog
deleted file mode 100644
index 4a562bd..0000000
--- a/cam/ChangeLog
+++ /dev/null
@@ -1,14 +0,0 @@
-0.3
----
-- added this changelog..
-
-0.4
----
-- added richlowe's patch. since he pretty much rewrote everything, he's
-an author, not a contributor. :)
-- uses "use strict" now
-- uses POD for documentation
-- added title support in cam bookmarks file
-- cmd line flag for different bookmars file
-- getoppt_long use for command-line flags
-- rmeoved richlow's damn nonstandard Pod::Usage stuff
diff --git a/cam/README b/cam/README
deleted file mode 100644
index e67d60e..0000000
--- a/cam/README
+++ /dev/null
@@ -1,45 +0,0 @@
-Cam 0.4 README
-==============
-This document was last updated on 20010223-1620-PST.
-Please see the file COPYING for licensing information.
-
-Description
-===========
-feh-cam is a Perl wrapper for feh that simlifies viewing webcams. It uses
-keyed bookmarks. Type "feh-cam --help" at the command line for usage
-information.
-
-Webcam Information
-==================
-All webcam images are the property of their respective owners. If you
-enjoy the cam, you should check out the page too! The initial list of
-cam bookmarks (in the cam_bookmarks file) is a combination of webcams
-scoured from the #E People Page (http://bma.debian.net/~bma/e-irc/),
-my favorite webcams from the Stile Project's cam pages
-(http://www.stileproject.com/), and additional #e people cams that
-have come online since cam's original release (0.1).
-
-Installation
-============
-- Copy the "feh-cam" script to a location in your PATH (ex /usr/bin,
- /usr/local/bin, or $HOME/bin), and make sure hte execute bit on the
- script is set (type "chmod a+x $HOME/.cam_bookmarks").
-- Copy the "cam_bookmarks" file to $HOME/.cam_bookmarks and make sure
- cam can see it by typing "feh-cam --list".
-- Optionally, modify the options inside the feh-cam script. You can pass
- feh any options before the image by adjusting the $PRE variable,
- and any options after the image by adjustin the $POST variable.
- For example, I like to keep all cam images by default; you can enable
- this behavior with the -k command line option, or enable it permanently
- by adding it to the $PRE flags in feh-cam.
-
-About the Authors
-=================
-Paul Duncan <pabs@pablotron.org>, pabs on #e
-http://www.pablotron.org/
-
-Richard Lowe <richlowe@btinternet.com>, richlowe on #e
-http://www.richlowe.btinternet.co.uk/
-
-...but the real credit goes to Tom Gilbert for making feh, an awesome
-image viewer. :)
diff --git a/cam/cam_bookmarks b/cam/cam_bookmarks
deleted file mode 100644
index 8d45413..0000000
--- a/cam/cam_bookmarks
+++ /dev/null
@@ -1,2 +0,0 @@
-nasa_shuttle=60,http://science.ksc.nasa.gov/shuttle/countdown/video/chan2large.jpg
-
diff --git a/cam/feh-cam b/cam/feh-cam
deleted file mode 100755
index 29b254f..0000000
--- a/cam/feh-cam
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use Getopt::Long;
-
-#############################################
-############# CAM RUN-TIME OPTIONS ##########
-#############################################
-my $feh = "feh";
-
-# additional feh cmdline options
-my $PRE = " -q -G -Twebcam -1 0 -0 1 ";
-my $POST = "";
-#############################################
-#############################################
-
-# Options
-my $help = '';
-my $fullscreen = '';
-my $geometry = '';
-my $list = '';
-my $verbose = '';
-my $add = '';
-my $keep = '';
-my $deftitle = '%cCAM - %u';
-my $title = '';
-my $bp = $ENV{HOME}."/.cam_bookmarks";
-my $DEBUG = 0;
-
-# check args
-&print_usage_and_exit unless (@ARGV);
-
-print STDERR "Note: feh-cam will be removed from the feh distribution in 2013.\n";
-print STDERR "Please mail derf\@finalrewind.org if you still use it.\n";
-
-
-# Url, Refresh, and bookmarks
-my $url = "";
-my $ref = "";
-my %bms = ();
-
-GetOptions('help|?|h' => \$help,
- 'full-screen|f|giblets-mom' => \$fullscreen,
- 'list|l' => \$list,
- 'geometry|g=s' => \$geometry,
- 'verbose|v' => \$verbose,
- 'add|a' => \$add,
- 'keep-images|k|save-pr0n' => \$keep,
- 'title|t=s' => \$title,
- 'debug|d' => \$DEBUG,
- 'bookmarks|b=s' => \$bp
- );
-
-my $key = shift @ARGV;
-
-&print_usage_and_exit if ($help);
-
-if ($verbose) {
- $PRE .= " -V ";
-}
-
-if ($fullscreen) {
- $PRE =~ s/-w//;
- $PRE .= " --full-screen --auto-zoom ";
-}
-
-if ($geometry) {
- $PRE .= " --geometry $geometry ";
-}
-
-# if requested, add a key/url pair to bookmarks file
-if ($add) {
- my $mytitle = '';
- ($url,$ref,$mytitle) = @ARGV;
- die "Bad key syntax\n" unless ($key && $url && $ref);
-
- $mytitle="" unless ($mytitle);
-
- open(BMF, ">>$bp") or die "Couldn't open bookmarks file \"$bp\": $!\n";
- print BMF "$key=$ref,$url \"$mytitle\"\n";
- close BMF;
- print "Added URL key \"$key\" = $url, $ref.\n"; # its useful to have this even if you arent debugging --richlowe
- exit 0;
-}
-
-if ($keep) {
- $PRE .= " -k ";
-}
-
-
-
-# load bookmarks
-open(BMF, "$bp") or die "Couldn't open bookmarks file \"$bp\": $!\n";
-foreach (<BMF>) {
- next unless /^(.*?)=(.*)$/;
- $bms{$1} = $2;
- print "key=$1, url=$2\n" if ($DEBUG);
-}
-close BMF;
-
-# if requested, dump a list of key/url pair values
-if ($list) {
- foreach (sort keys %bms) {
- my $t = $bms{$_};
-
- $t =~ s/^(.+?),(.+?)(^ "(.*)"|)?$/$2/;
- chomp $t;
- print "$_ = $t, $1, $3\n";
- }
- exit 0;
-}
-
-# main loop
-MAIN: {
- do {
- $title="";
- $url = $bms{$key};
- die "Couldn't find URL key \"$key.\"\n" unless($url);
-
- $url =~ s/^(.+?),(.+?)( "(.*)")?$/$2/;
- $ref = $1;
-
- if ($4) {
- $title = $4;
- } else {
- $title = $deftitle;
- }
-
- if ($title) {
- $title =~ s/\%c/$key/g;
- $title =~ s/\%u/$url/g;
- $title =~ s/\%r/$ref/g;
- $title =~ s/\%\%/\%/g;
- $title = " --title \"$title\" ";
- }
-
- my $cmd = "$feh $PRE $title -T".$key."cam -R $ref $url $POST";
- print "$cmd\n" if ($DEBUG);
- FORK: {
- my $pid;
- if ($pid = fork) {
- # We're a daddy! :)
- } elsif (defined $pid) {
- # child
- exec "$cmd" or die "Couldnt exec() $feh: $!\n";
- } elsif ( $! =~ /No more process/) {
- sleep 5;
- redo FORK;
- } else {
- # wtf?
- die "Unrecoverable fork() error: $!\n";
- }
- }
- } while ($key = shift @ARGV);
-}
-
-
-sub print_usage_and_exit() {
- print <<END_USAGE;
-$0 0.4
-by Paul Duncan <pabs\@pablotron.org>, and
- Richard Lowe <richlowe\@btinternet.com>
-
-Description:
- A convenient webcam wrapper for feh.
-
-Usage:
- $0 <keys>
- Load the urls specified by the given keys.
- key : a url key stored in the bookmarks file (\"$bp\").
- $0 <-a|--add> key url refresh
- Add a key to the bookmarks file.
- key : short key (ex \"jenni\"),
- url : url (ex \"http://www.jennicam.org/webcam/cam.jpg\"),
- refresh : refresh, in seconds (ex 120)
- $0 <-l|--list>
- List each url key in the bookmarks file (\"$bp\").
- $0 [-f|--full-screen] keys
- Start feh in full-screen mode (aka --giblets-mom \"viewing\" mode).
- $0 [-k|--keep-images] keys
- Save each image in the current directory (aka --save-pr0n).
- $0 [-g|--geometry] xxx
- Use window geometry xxx (e.g. 640x480).
- $0 [-v|--verbose] options
- Start feh in verbose mode (feh -V).
- $0 <-h|-?|--help>
- Display usage information (this screen).
-
-Notes:
-Thanks to giblet for feh, an awesome image and webcam viewing program,
-and raster for Imlib2.
-END_USAGE
- exit(-1);
-}
-
diff --git a/cam/gen-cam-menu b/cam/gen-cam-menu
deleted file mode 100755
index 710070b..0000000
--- a/cam/gen-cam-menu
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-######################################################################
-# gen_cam_menu.sh 0.1 #
-# by Paul Duncan <pabs@pablotron.org> #
-# #
-# This script will generate a menu of cam bookmarks for #
-# Enlightenment DR0.16.x. TYou can safely run this script more than #
-# once; it won't add an another entry to the left-click menu if it's #
-# already been run once. It doesn't delete any existing menu #
-# entries, and it backs up your existing menu files as well. (just #
-# in case I screwed up.. hehe). THe two variables below allow you #
-# rename the left-click menuitem, and the menu title. #
-# #
-# #
-MENU_ITEM="Webcams"; #
-MENU_TITLE="Webcam List"; #
-BMARKS=$HOME"/.cam_bookmarks"; #
-# #
-######################################################################
-
-
-C_MENUFILE="webcam.menu";
-F_MENUFILE="file.menu";
-C_MENU=$HOME"/.enlightenment/"$C_MENUFILE;
-F_MENU=$HOME"/.enlightenment/"$F_MENUFILE;
-
-# make backups, just in case
-cp -f $C_MENU $C_MENU"-cam_menu.backup"
-cp -f $F_MENU $F_MENU"-cam_menu.backup"
-
-echo "Note: gen-cam-menu will be removed from the feh distribution by 2013." > /dev/stderr
-echo "Please mail derf@finalrewind.org if you still use it." > /dev/stderr
-
-# generate cam menu
-echo "Generating \""$C_MENU"\".";
-echo "\"$TITLE\"" > "$C_MENU";
-cat $BMARKS | perl -e "while (<>) { /(.*?)=/; \$keys{\$1}=\"1\"; } foreach(sort keys %keys) { /(.)(.*$)/; print \"\\\"\".uc(\$1).\"\$2\\\" NULL exec \\\"feh-cam \$1\$2\\\"\\n\"; }">> $C_MENU;
-
-# add entry to file menu if there isn't one
-echo "Generating \""$F_MENU"\".";
-perl -i -e "\$already_there=0; while (<>) { \$already_there++ if (/$MENU_ITEM/); print \"\\\"$MENU_ITEM\\\" NULL menu \\\"$C_MENUFILE\\\"\\n\" if (!\$already_there&&/Restart/); print; }" $F_MENU;
-
-echo "Done.";
diff --git a/config.mk b/config.mk
index 226c612..43cc394 100644
--- a/config.mk
+++ b/config.mk
@@ -2,7 +2,6 @@ PACKAGE ?= feh
VERSION ?= ${shell git describe --dirty}
app ?= 0
-cam ?= 0
curl ?= 1
debug ?= 0
exif ?= 0
diff --git a/man/feh-cam.pre b/man/feh-cam.pre
deleted file mode 100644
index 4a02753..0000000
--- a/man/feh-cam.pre
+++ /dev/null
@@ -1,57 +0,0 @@
-.Dd $DATE$
-.Dt FEH-CAM 1
-.Os
-.
-.Sh NAME
-.Nm feh-cam
-.Nd utility for viewing live webcam images
-.Sh SYNOPSIS
-.Nm
-.Op Ar options
-.Ar keys
-.
-.Sh VERSION
-This manual documents feh-cam, shipped with feh version $VERSION$
-.
-.Sh DEPRECATION WARNING
-.
-This tool will be removed from the feh distribution by 2013.
-.
-.Pp
-.
-If you still use it, please contact me at
-.Aq derf@finalrewind.org
-.
-.Sh DESCRIPTION
-.Nm
-is a perl wrapper for feh which simplifies viewing webcams using keyed
-bookmarks. It helps manage viewing your favourite webcam sites with feh.
-.
-.Sh OPTIONS
-.Bl -tag -width indent
-.It Cm -a , --add Ar key url refresh
-Add
-.Ar url
-as
-.Ar key
-to the bookmarks file; when viewing, reload it every
-.Ar refresh
-seconds
-.It Cm -l , --list
-List each url / key pair in the bookmarks file
-.It Cm -f , --full-screen
-Start feh in full-screen mode
-.It Cm -k , --keep-images
-Save each webcam image in the current directory
-.It Cm -g , --geometry Ar width No x Ar height
-Use window geometry
-.Ar width No x Ar height
-.It Cm -v , --verbose
-Start feh in verbose mode
-.El
-.
-.Sh FILES
-The bookmarks are stored in
-.Pa ~/.cam_bookmarks
-.Sh SEE ALSO
-.Xr feh 1
diff --git a/man/feh.pre b/man/feh.pre
index a1698e1..583e68f 100644
--- a/man/feh.pre
+++ b/man/feh.pre
@@ -268,12 +268,6 @@ instead.
See
.Sx FORMAT SPECIFIERS .
.
-.It Cm --cycle-once
-.
-Exit
-.Nm
-after one loop through the slideshow.
-.
.It Cm -G , --draw-actions
.
Draw the defined actions and what they do at the top-left of the image.
@@ -556,6 +550,41 @@ in certain window managers.
.Pq optional feature, $MAN_XINERAMA$ in this build
Disable Xinerama support.
.
+.It Cm --on-last-slide Cm hold | Cm quit | Cm resume
+.
+Select behaviour when trying to select the next image on the last slide
+.Pq or the previous image on the first slide
+in a slide show.
+.
+.Pp
+.
+With
+.Cm hold ,
+.Nm
+will stop advancing images in this case and continue displaying the first/last
+image, respectively.
+This is intended for linear slide shows.
+Behaviour is unspecified when using other navigation commands than previous
+and next image.
+.
+.Pp
+.
+.Cm quit
+will cause
+.Nm
+to quit when trying to advance past the last image in the slide show.
+.
+.Pp
+.
+.Cm resume
+is the default behaviour: On the last
+.Pq first
+image,
+.Nm
+will wrap around to the first
+.Pq last
+image.
+.
.It Cm -j , --output-dir Ar directory
.
Save files to
@@ -659,16 +688,33 @@ in paused mode.
.
.It Cm -S , --sort Ar sort_type
.
-The file list may be sorted according to image parameters.
+Sort file list according to image parameters.
Allowed sort types are: name, filename, dirname, mtime, width, height, pixels,
size, format.
-For sort modes other than name, filename, dirname, or mtime, a preload run will
-be necessary, causing a delay proportional to the number of images in the list.
+For sort modes other than name, filename, dirname, or mtime, a preload run is
+necessary, causing a delay proportional to the number of images in the list.
.
.Pp
.
-The mtime sort mode sorts images by most recently modified.
-To sort by oldest first, reverse the filelist with --reverse.
+.Cm mtime
+starts with the most recently modified image,
+.Cm width , height , pixels
+and
+.Cm size
+start with the smallest.
+Use
+.Cm --reverse
+to sort by oldest or largest first.
+.
+.Pp
+.
+For
+.Cm name , filename ,
+and
+.Cm dirname ,
+you can use
+.Cm --version-sort
+to sort numbers naturally, so that e.g. 10.jpg comes after 2.jpg.
.
.It Cm -| , --start-at Ar filename
.
@@ -752,11 +798,17 @@ output version information and exit.
.It Cm --version-sort
.
.Pq optional feature, $MAN_VERSCMP$ in this build
-Use natural sorting for file and directory names.
+When combined with
+.Cm --sort name , --sort filename ,
+or
+.Cm --sort dirname :
+use natural sorting for file and directory names.
In this mode, filenames are sorted as an ordinary human would expect, e.g.
.Qq 2.jpg
comes before
.Qq 10.jpg .
+Note that this option only has an effect when a sort mode is set using
+.Cm --sort .
.
.It Cm --xinerama-index Ar screen
.
diff --git a/man/gen-cam-menu.pre b/man/gen-cam-menu.pre
deleted file mode 100644
index 18064f1..0000000
--- a/man/gen-cam-menu.pre
+++ /dev/null
@@ -1,33 +0,0 @@
-.Dd $DATE$
-.Dt GEN-CAM-MENU 1
-.Os
-.
-.Sh NAME
-.Nm gen-cam-menu
-.Nd utility for updating Enlightenment user menus for feh-cam
-.Sh SYNOPSIS
-.Nm
-.
-.Sh VERSION
-This manual documents gen-cam-menu, shipped with feh version $VERSION$
-.
-.Sh DEPRECATION WARNING
-.
-This tool will be removed from the feh distribution by 2013.
-.
-.Pp
-.
-If you still use it, please contact me at
-.Aq derf@finalrewind.org
-.
-.Sh DESCRIPTION
-.Nm
-is a shell script which creates Enlightenment user menu entries for the
-bookmarks stored by
-.Xr feh-cam 1
-in
-.Pa ~/.enlightenment/ .
-.
-.Sh SEE ALSO
-.Xr feh 1 ,
-.Xr feh-cam 1
diff --git a/src/Makefile b/src/Makefile
index 8a9f97e..ac4d2fe 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,7 +1,6 @@
include ../config.mk
TARGETS = \
- collage.c \
events.c \
feh_png.c \
filelist.c \
diff --git a/src/collage.c b/src/collage.c
deleted file mode 100644
index 2a4d9f9..0000000
--- a/src/collage.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/* collage.c
-
-Copyright (C) 1999-2003 Tom Gilbert.
-Copyright (C) 2010-2018 Daniel Friesel.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies of the Software and its documentation and acknowledgment shall be
-given in the documentation and software packages that this Software was
-used.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-
-#include "feh.h"
-#include "winwidget.h"
-#include "filelist.h"
-#include "options.h"
-
-void init_collage_mode(void)
-{
- Imlib_Image im_main;
- Imlib_Image im_temp;
- int ww, hh, www, hhh, xxx, yyy;
- int w = 800, h = 600;
- int bg_w = 0, bg_h = 0;
- winwidget winwid = NULL;
- Imlib_Image bg_im = NULL, im_thumb = NULL;
- feh_file *file = NULL;
- unsigned char trans_bg = 0;
- gib_list *l, *last = NULL;
-
- mode = "collage";
-
- weprintf("the --collage option (aka collage mode) is deprecated\n"
- "and will be removed soon\n");
-
- /* Use bg image dimensions for default size */
- if (opt.bg && opt.bg_file) {
- if (!strcmp(opt.bg_file, "trans"))
- trans_bg = 1;
- else {
-
- D(("Time to apply a background to blend onto\n"));
- if (feh_load_image_char(&bg_im, opt.bg_file) != 0) {
- bg_w = gib_imlib_image_get_width(bg_im);
- bg_h = gib_imlib_image_get_height(bg_im);
- }
- }
- }
-
- if (!opt.limit_w || !opt.limit_h) {
- if (bg_im) {
- if (opt.verbose)
- fputs(PACKAGE
- ": No size restriction specified for collage.\n"
- " You did specify a background however, so the\n"
- " collage size has defaulted to the size of the image\n",
- stderr);
- opt.limit_w = bg_w;
- opt.limit_h = bg_h;
- } else {
- if (opt.verbose)
- fputs(PACKAGE
- ": No size restriction specified for collage.\n"
- " - For collage mode, you need to specify width and height.\n"
- " Using defaults (width 800, height 600)\n",
- stderr);
- opt.limit_w = 800;
- opt.limit_h = 600;
- }
- }
-
- w = opt.limit_w;
- h = opt.limit_h;
- D(("Limiting width to %d and height to %d\n", w, h));
-
- im_main = imlib_create_image(w, h);
-
- if (!im_main)
- eprintf("Imlib error creating image");
-
- if (bg_im)
- gib_imlib_blend_image_onto_image(im_main, bg_im,
- gib_imlib_image_has_alpha(bg_im), 0, 0,
- bg_w, bg_h, 0, 0, w, h, 1, 0, 0);
- else if (trans_bg) {
- gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 0);
- gib_imlib_image_set_has_alpha(im_main, 1);
- } else {
- /* Colour the background */
- gib_imlib_image_fill_rectangle(im_main, 0, 0, w, h, 0, 0, 0, 255);
- }
-
- if (opt.display) {
- winwid = winwidget_create_from_image(im_main, WIN_TYPE_SINGLE);
- winwidget_rename(winwid, PACKAGE " [collage mode]");
- winwidget_show(winwid);
- }
-
- for (l = filelist; l; l = l->next) {
- file = FEH_FILE(l->data);
- if (last) {
- filelist = feh_file_remove_from_list(filelist, last);
- last = NULL;
- }
- D(("About to load image %s\n", file->filename));
- if (feh_load_image(&im_temp, file) != 0) {
- D(("Successfully loaded %s\n", file->filename));
- if (opt.verbose)
- feh_display_status('.');
- www = opt.thumb_w;
- hhh = opt.thumb_h;
- ww = gib_imlib_image_get_width(im_temp);
- hh = gib_imlib_image_get_height(im_temp);
-
- if (opt.aspect) {
- double ratio = 0.0;
-
- /* Keep the aspect ratio for the thumbnail */
- ratio = ((double) ww / hh) / ((double) www / hhh);
-
- if (ratio > 1.0)
- hhh = opt.thumb_h / ratio;
- else if (ratio != 1.0)
- www = opt.thumb_w * ratio;
- }
-
- if ((!opt.stretch) && ((www > ww) || (hhh > hh))) {
- /* Don't make the image larger unless stretch is specified */
- www = ww;
- hhh = hh;
- }
-
- /* pick random coords for thumbnail */
- xxx = ((w - www) * ((double) rand() / RAND_MAX));
- yyy = ((h - hhh) * ((double) rand() / RAND_MAX));
- D(("image going on at x=%d, y=%d\n", xxx, yyy));
-
- im_thumb = gib_imlib_create_cropped_scaled_image(im_temp,
- 0, 0, ww, hh, www, hhh, 1);
- gib_imlib_free_image_and_decache(im_temp);
-
- if (opt.alpha) {
- DATA8 atab[256];
-
- D(("Applying alpha options\n"));
- gib_imlib_image_set_has_alpha(im_thumb, 1);
- memset(atab, opt.alpha_level, sizeof(atab));
- gib_imlib_apply_color_modifier_to_rectangle(im_thumb,
- 0, 0, www, hhh, NULL, NULL, NULL, atab);
- }
- gib_imlib_blend_image_onto_image(im_main, im_thumb,
- gib_imlib_image_has_alpha(im_thumb), 0, 0, www, hhh, xxx,
- yyy,www, hhh, 1, gib_imlib_image_has_alpha(im_thumb), 0);
- gib_imlib_free_image_and_decache(im_thumb);
- } else {
- last = l;
- if (opt.verbose)
- feh_display_status('x');
- }
- if (opt.display) {
- winwidget_render_image(winwid, 0, 0);
- if (!feh_main_iteration(0))
- exit(0);
- }
- }
- if (opt.verbose)
- fputs("\n", stderr);
-
- if (opt.output && opt.output_file) {
- char output_buf[1024];
- if (opt.output_dir)
- snprintf(output_buf, 1024, "%s/%s", opt.output_dir, opt.output_file);
- else {
- strncpy(output_buf, opt.output_file, 1023);
- output_buf[1023] = '\0';
- }
- gib_imlib_save_image(im_main, output_buf);
- if (opt.verbose) {
- int tw, th;
-
- tw = gib_imlib_image_get_width(im_main);
- th = gib_imlib_image_get_height(im_main);
- fprintf(stderr, PACKAGE ": File saved as %s\n", output_buf);
- fprintf(stderr,
- " - Image is %dx%d pixels and contains %d thumbnails\n",
- tw, th, (tw / opt.thumb_w) * (th / opt.thumb_h));
- }
- }
-
- if (!opt.display)
- gib_imlib_free_image_and_decache(im_main);
-
- return;
-}
diff --git a/src/feh.h b/src/feh.h
index 009f45b..1d5e918 100644
--- a/src/feh.h
+++ b/src/feh.h
@@ -132,7 +132,6 @@ void init_xinerama(void);
#endif /* HAVE_LIBXINERAMA */
void init_multiwindow_mode(void);
void init_thumbnail_mode(void);
-void init_collage_mode(void);
void init_index_mode(void);
void init_slideshow_mode(void);
void init_list_mode(void);
diff --git a/src/filelist.c b/src/filelist.c
index b492965..3f3c96d 100644
--- a/src/filelist.c
+++ b/src/filelist.c
@@ -37,6 +37,7 @@ gib_list *original_file_items = NULL; /* original file items from argv */
int filelist_len = 0;
gib_list *current_file = NULL;
extern int errno;
+extern int sig_exit; /* exit flag from signal handler */
static gib_list *rm_filelist = NULL;
@@ -327,6 +328,10 @@ gib_list *feh_file_info_preload(gib_list * list)
feh_display_status('s');
} else if (opt.verbose)
feh_display_status('.');
+ if (sig_exit) {
+ feh_display_status(0);
+ exit(sig_exit);
+ }
}
if (opt.verbose)
feh_display_status(0);
@@ -486,7 +491,7 @@ void feh_prepare_filelist(void)
* we can create a properly sized thumbnail list.
*/
if (opt.list || opt.preload || opt.customlist || (opt.sort > SORT_MTIME)
- || (opt.filter_by_dimensions && (opt.index || opt.collage || opt.thumbs || opt.bgmode))) {
+ || (opt.filter_by_dimensions && (opt.index || opt.thumbs || opt.bgmode))) {
/* For these sort options, we have to preload images */
filelist = feh_file_info_preload(filelist);
if (!gib_list_length(filelist))
diff --git a/src/gib_imlib.c b/src/gib_imlib.c
index 8f401aa..7858cb7 100644
--- a/src/gib_imlib.c
+++ b/src/gib_imlib.c
@@ -717,3 +717,15 @@ void gib_imlib_image_orientate(Imlib_Image im, int orientation)
imlib_context_set_image(im);
imlib_image_orientate(orientation);
}
+
+void gib_imlib_image_flip_horizontal(Imlib_Image im)
+{
+ imlib_context_set_image(im);
+ imlib_image_flip_horizontal();
+}
+
+void gib_imlib_image_flip_vertical(Imlib_Image im)
+{
+ imlib_context_set_image(im);
+ imlib_image_flip_vertical();
+}
diff --git a/src/gib_imlib.h b/src/gib_imlib.h
index 6a16a0c..07daabe 100644
--- a/src/gib_imlib.h
+++ b/src/gib_imlib.h
@@ -181,6 +181,8 @@ void gib_imlib_parse_color(char *col, int *r, int *g, int *b, int *a);
void gib_imlib_parse_fontpath(char *path);
Imlib_Font gib_imlib_load_font(char *name);
void gib_imlib_image_orientate(Imlib_Image im, int orientation);
+void gib_imlib_image_flip_horizontal(Imlib_Image im);
+void gib_imlib_image_flip_vertical(Imlib_Image im);
#ifdef __cplusplus
}
diff --git a/src/gib_list.c b/src/gib_list.c
index 5384d98..a8ba1dd 100644
--- a/src/gib_list.c
+++ b/src/gib_list.c
@@ -362,7 +362,7 @@ gib_list_randomize(gib_list * list)
}
for (i = 0; i < len - 1; i++)
{
- r = i + rand() / (RAND_MAX / (len - i) + 1 );
+ r = i + random() / (RAND_MAX / (len - i) + 1 );
t = farray[r];
farray[r] = farray[i];
farray[i] = t;
diff --git a/src/help.raw b/src/help.raw
index 86bb617..c8de3d7 100644
--- a/src/help.raw
+++ b/src/help.raw
@@ -38,7 +38,8 @@ OPTIONS
--auto-rotate Rotate images according to Exif info (if compiled with exif=1)
-^, --title TITLE Set window title (see FORMAT SPECIFIERS)
-D, --slideshow-delay NUM Set delay between automatically changing slides
- --cycle-once Exit after one loop through the slideshow
+ --on-last-slide quit Exit after one loop through the slide show
+ --on-last-slide hold Stop at both ends of the filelist
-R, --reload NUM Reload images after NUM seconds
-k, --keep-http Keep local copies when viewing HTTP/FTP files
--insecure Disable peer/host verification when using HTTPS.
@@ -90,8 +91,8 @@ OPTIONS
--no-xinerama Disable Xinerama support
--no-screen-clip Do not limit window size to screen size
-Y, --hide-pointer Hide the pointer
- --magick-timeout INT Load unknown files with ImageMagick, timeout after
- INT seconds (0: no timeout)
+ --conversion-timeout INT Load unknown files with dcraw or ImageMagick,
+ timeout after INT seconds (0: no timeout)
--min-dimension WxH Only show images with width >= W and height >= H
--max-dimension WxH Only show images with width <= W and height <= H
--scroll-step COUNT scroll COUNT pixels when movement key is pressed
diff --git a/src/imlib.c b/src/imlib.c
index 91b635e..2c04128 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -294,10 +294,22 @@ int feh_load_image(Imlib_Image * im, feh_file * file)
}
file->ed = exifData;
- if (orientation == 3)
+ if (orientation == 2)
+ gib_imlib_image_flip_horizontal(*im);
+ else if (orientation == 3)
gib_imlib_image_orientate(*im, 2);
+ else if (orientation == 4)
+ gib_imlib_image_flip_vertical(*im);
+ else if (orientation == 5) {
+ gib_imlib_image_orientate(*im, 3);
+ gib_imlib_image_flip_vertical(*im);
+ }
else if (orientation == 6)
gib_imlib_image_orientate(*im, 1);
+ else if (orientation == 7) {
+ gib_imlib_image_orientate(*im, 3);
+ gib_imlib_image_flip_horizontal(*im);
+ }
else if (orientation == 8)
gib_imlib_image_orientate(*im, 3);
#endif
diff --git a/src/keyevents.c b/src/keyevents.c
index 689aebd..43bc82a 100644
--- a/src/keyevents.c
+++ b/src/keyevents.c
@@ -686,7 +686,7 @@ void feh_event_handle_generic(winwidget winwid, unsigned int state, KeySym keysy
}
else if (feh_is_kp(EVENT_jump_random, state, keysym, button)) {
if (winwid->type == WIN_TYPE_THUMBNAIL)
- feh_thumbnail_select_next(winwid, rand() % (filelist_len - 1));
+ feh_thumbnail_select_next(winwid, random() % (filelist_len - 1));
else
slideshow_change_image(winwid, SLIDE_RAND, 1);
}
diff --git a/src/main.c b/src/main.c
index 1a76e2d..0d1cc4d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
{
atexit(feh_clean_exit);
- srand(getpid() * time(NULL) % ((unsigned int) -1));
+ srandom(getpid() * time(NULL) % ((unsigned int) -1));
setup_signal_handlers();
init_parse_options(argc, argv);
@@ -59,8 +59,6 @@ int main(int argc, char **argv)
if (opt.index)
init_index_mode();
- else if (opt.collage)
- init_collage_mode();
else if (opt.multiwindow)
init_multiwindow_mode();
else if (opt.list || opt.customlist)
diff --git a/src/options.c b/src/options.c
index d3066ef..dc6a9ff 100644
--- a/src/options.c
+++ b/src/options.c
@@ -354,7 +354,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
{"title" , 1, 0, '^'},
{"alpha" , 1, 0, 'a'},
{"bg" , 1, 0, 'b'},
- {"collage" , 0, 0, 'c'},
{"draw-filename" , 0, 0, 'd'},
{"font" , 1, 0, 'e'},
{"filelist" , 1, 0, 'f'},
@@ -415,6 +414,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
{"insecure" , 0, 0, 240},
{"no-recursive" , 0, 0, 241},
{"cache-size" , 1, 0, 243},
+ {"on-last-slide" , 1, 0, 244},
{"conversion-timeout" , 1, 0, 245},
{"version-sort" , 0, 0, 246},
{"offset" , 1, 0, 247},
@@ -578,9 +578,6 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
opt.bg = 1;
opt.bg_file = estrdup(optarg);
break;
- case 'c':
- opt.collage = 1;
- break;
case 'd':
opt.draw_filename = 1;
break;
@@ -743,7 +740,8 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
break;
#endif
case 224:
- opt.cycle_once = 1;
+ weprintf("--cycle-once is deprecated, please use --on-last-slide=quit instead");
+ opt.on_last_slide = ON_LAST_SLIDE_QUIT;
break;
case 225:
opt.xinerama = 0;
@@ -786,6 +784,18 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
if (opt.cache_size > 2048)
opt.cache_size = 2048;
break;
+ case 244:
+ if (!strcmp(optarg, "quit")) {
+ opt.on_last_slide = ON_LAST_SLIDE_QUIT;
+ } else if (!strcmp(optarg, "hold")) {
+ opt.on_last_slide = ON_LAST_SLIDE_HOLD;
+ } else if (!strcmp(optarg, "resume")) {
+ opt.on_last_slide = ON_LAST_SLIDE_RESUME;
+ } else {
+ weprintf("Unrecognized on-last-slide action \"%s\"."
+ "Supported actions: hold, resume, quit\n", optarg);
+ }
+ break;
case 245:
opt.conversion_timeout = atoi(optarg);
break;
@@ -843,17 +853,11 @@ static void check_options(void)
}
}
- if ((opt.index + opt.collage) > 1) {
- weprintf("you can't use collage mode and index mode together.\n"
- " I'm going with index");
- opt.collage = 0;
- }
-
if (opt.full_screen && opt.multiwindow) {
eprintf("You cannot combine --fullscreen with --multiwindow");
}
- if (opt.list && (opt.multiwindow || opt.index || opt.collage)) {
+ if (opt.list && (opt.multiwindow || opt.index)) {
eprintf("You cannot combine --list with other modes");
}
@@ -889,6 +893,10 @@ static void show_version(void)
"stat64 "
#endif
+#ifdef HAVE_VERSCMP
+ "verscmp "
+#endif
+
#ifdef HAVE_LIBXINERAMA
"xinerama "
#endif
diff --git a/src/options.h b/src/options.h
index bd2dfad..5734b54 100644
--- a/src/options.h
+++ b/src/options.h
@@ -27,10 +27,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef OPTIONS_H
#define OPTIONS_H
+enum on_last_slide_action {
+ ON_LAST_SLIDE_RESUME = 0,
+ ON_LAST_SLIDE_QUIT,
+ ON_LAST_SLIDE_HOLD
+};
+
struct __fehoptions {
unsigned char multiwindow;
unsigned char montage;
- unsigned char collage;
unsigned char index;
unsigned char thumbs;
unsigned char slideshow;
@@ -68,7 +73,7 @@ struct __fehoptions {
unsigned char draw_actions;
unsigned char draw_info;
unsigned char cache_thumbnails;
- unsigned char cycle_once;
+ unsigned char on_last_slide;
unsigned char hold_actions[10];
unsigned char text_bg;
unsigned char no_fehbg;
diff --git a/src/slideshow.c b/src/slideshow.c
index e87d1b9..b404318 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -215,6 +215,7 @@ void feh_reload_image(winwidget w, int resize, int force_new)
void slideshow_change_image(winwidget winwid, int change, int render)
{
gib_list *last = NULL;
+ gib_list *previous_file = current_file;
int i = 0;
int jmp = 1;
/* We can't use filelist_len in the for loop, since that changes when we
@@ -227,7 +228,7 @@ void slideshow_change_image(winwidget winwid, int change, int render)
/* Without this, clicking a one-image slideshow reloads it. Not very *
intelligent behaviour :-) */
- if (filelist_len < 2 && opt.cycle_once == 0)
+ if (filelist_len < 2 && opt.on_last_slide != ON_LAST_SLIDE_QUIT)
return;
/* Ok. I do this in such an odd way to ensure that if the last or first *
@@ -237,9 +238,11 @@ void slideshow_change_image(winwidget winwid, int change, int render)
if (change == SLIDE_FIRST) {
current_file = gib_list_last(filelist);
change = SLIDE_NEXT;
+ previous_file = NULL;
} else if (change == SLIDE_LAST) {
current_file = filelist;
change = SLIDE_PREV;
+ previous_file = NULL;
}
/* The for loop prevents us looping infinitely */
@@ -255,7 +258,7 @@ void slideshow_change_image(winwidget winwid, int change, int render)
case SLIDE_RAND:
if (filelist_len > 1) {
current_file = feh_list_jump(filelist, current_file, FORWARD,
- (rand() % (filelist_len - 1)) + 1);
+ (random() % (filelist_len - 1)) + 1);
change = SLIDE_NEXT;
}
break;
@@ -335,6 +338,12 @@ void slideshow_change_image(winwidget winwid, int change, int render)
last = NULL;
}
+ if (opt.on_last_slide == ON_LAST_SLIDE_HOLD && previous_file &&
+ ((current_file == filelist && change == SLIDE_NEXT) ||
+ (previous_file == filelist && change == SLIDE_PREV))) {
+ current_file = previous_file;
+ }
+
if (winwidget_loadimage(winwid, FEH_FILE(current_file->data))) {
int w = gib_imlib_image_get_width(winwid->im);
int h = gib_imlib_image_get_height(winwid->im);
@@ -568,10 +577,10 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete)
doomed = current_file;
/*
- * work around feh_list_jump exiting if cycle_once is enabled
+ * work around feh_list_jump exiting if ON_LAST_SLIDE_QUIT is set
* and no further files are left (we need to delete first)
*/
- if (opt.cycle_once && ! doomed->next && do_delete) {
+ if (opt.on_last_slide == ON_LAST_SLIDE_QUIT && ! doomed->next && do_delete) {
feh_file_rm_and_free(filelist, doomed);
exit(0);
}
@@ -647,7 +656,7 @@ gib_list *feh_list_jump(gib_list * root, gib_list * l, int direction, int num)
if (ret->next) {
ret = ret->next;
} else {
- if (opt.cycle_once) {
+ if (opt.on_last_slide == ON_LAST_SLIDE_QUIT) {
exit(0);
}
if (opt.randomize) {
diff --git a/src/wallpaper.c b/src/wallpaper.c
index db14a8c..ef7ecca 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -252,7 +252,7 @@ void feh_wm_set_bg(char *fil, Imlib_Image im, int centered, int scaled,
XGCValues gcval;
GC gc;
char bgname[20];
- int num = (int) rand();
+ int num = (int) random();
char bgfil[4096];
char sendbuf[4096];
diff --git a/src/winwidget.c b/src/winwidget.c
index fe0b505..b68d56f 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -520,7 +520,7 @@ void winwidget_render_image(winwidget winwid, int resize, int force_alias)
D(("sx: %d sy: %d sw: %d sh: %d dx: %d dy: %d dw: %d dh: %d zoom: %f\n",
sx, sy, sw, sh, dx, dy, dw, dh, winwid->zoom));
- if ((winwid->zoom != 1.0) && !force_alias && !winwid->force_aliasing)
+ if ((winwid->zoom != 1.0 || winwid->has_rotated) && !force_alias && !winwid->force_aliasing)
antialias = 1;
D(("winwidget_render(): winwid->im_angle = %f\n", winwid->im_angle));
diff --git a/test/mandoc.t b/test/mandoc.t
index 638c5e9..48b8443 100755
--- a/test/mandoc.t
+++ b/test/mandoc.t
@@ -20,7 +20,7 @@ SKIP: {
skip( 'mandoc not installed', 3 );
}
- for my $file ( 'feh', 'feh-cam', 'gen-cam-menu' ) {
+ for my $file ('feh') {
qx{mandoc -Tlint -Werror man/${file}.1};
is( $?, 0, "${file}.1: Valid mdoc syntax" );
}
diff --git a/test/status b/test/status
index 2cda6d8..0151bcd 100644
--- a/test/status
+++ b/test/status
@@ -76,8 +76,6 @@ Overall test status, what's covered / missing
[x] correct caption display
---collage
-
--customlist
[x] correct output