Commit Graph

193 Commits

Author SHA1 Message Date
Bert Münnich
f02661879f Reject text files resembling TGA images
Fixes issue #295

The imlib2 TGA loader returns an imlib image handle without any actual data
when given a text file like this:

    T
    Content-Type: application/javascript
    Content-Length: 3836
    Last-Modified: Wed, 23 Sep 2015 12:25:47 GMT
    Etag: "56029a4b-efc"
    Expires: Sat, 20 Aug 2016 15:14:33 GMT
    Cache-Control: max-age=604800, public
    Accept-Ranges: bytes

Fortunately, `imlib_image_get_data()` returns NULL in this case, so that we can
use it as an additional check when opening files.
2017-11-23 14:35:34 +01:00
Bert Münnich
148026007c One header file for type definitions and function declarations 2017-10-16 21:10:35 +02:00
Bert Münnich
a5403178e3 Zoom into mouse cursor position 2017-10-16 10:56:53 +02:00
Bert Münnich
e310136e02 Mouse drag translates pointer position to image area
This makes mouse panning more direct and faster.
2017-10-04 18:22:43 +02:00
jcalve
ec545a6b6c Make pan fraction configurable 2017-09-06 19:39:22 +02:00
Bert Münnich
ff2ce99bf7 Merge djhejna/floatdelay 2016-12-01 21:18:41 +01:00
Don Hejna
27bbaab976 Support for DELAY as a floating point number including less than 1
second while maintaining backward compatibiitiy with integer
arguments.
2016-11-27 20:36:23 -08:00
dwminer
2c566c5320 Add -A option to force framerate on animated images 2016-11-27 02:59:05 -05:00
Bert Münnich
878d97068c Only open regular files; fixes issue #252 2016-10-20 10:21:55 +02:00
Bert Münnich
c280129cef Use Xft for font loading and text drawing 2016-08-06 15:27:58 +02:00
Bert Münnich
4db3029bc6 Fix 32-bit unsigned integer shift 2015-12-26 10:14:35 +01:00
Bert Münnich
d3a70a285d Revised error handling
- Functions warn() and die() replaced by GNU-like error(3) function
- Register cleanup() with atexit(3)
- Functions called by cleanup() are marked with CLEANUP and are not allowed to
  call exit(3)
2015-10-28 23:03:37 +01:00
Bert Münnich
851e4288c1 Prefix safe allocation functions with 'e' instead of 's_' 2015-10-28 22:29:01 +01:00
Bert Münnich
e574a6d0dd Removed feature test macro definitions from source files 2015-10-28 21:37:45 +01:00
Bert Münnich
e0e96977b3 Removed overcautious parameter checks 2015-10-28 21:01:24 +01:00
Bert Münnich
01ed483b50 Round integer cast of image offset during rendering; fixes issue #197 2015-02-06 08:52:44 +01:00
Bert Münnich
47e6cd0669 Apply gamma value on thumbnails too; fixes issue #193 2015-01-05 20:53:04 +01:00
Bert Münnich
9b9294bae6 Use bit-field for boolean flags in fileinfo struct 2015-01-04 21:24:43 +01:00
Bert Münnich
93e2a757d4 Do not print could-not-open-warnings for files found by directory traversal 2014-10-24 11:14:01 +02:00
Bert Münnich
2fbc21a205 Simplified img_frame_animate 2014-09-01 20:41:33 +02:00
Bert Münnich
bb6721549b Overhauled window drawing, yet again; fixes issue #155
- Buffer for window content is bigger than the window, minimizes artifacts
  when window is resized
- Back to using XSetWindowBackgroundPixmap() instead of XCopyArea(),
  no need to handle exposure events; X server can show gray background directly
  after resize event before sxiv redraws the window contents
2014-07-28 20:36:32 +02:00
Bert Münnich
5e481912ec Revised handling of GIF animations
- New option `-a`: Play animations at startup
- Ctrl-Space toggles animation for all GIF files
- Infinite loop for all animations
2014-07-25 22:52:31 +02:00
Bert Münnich
9c92de8584 Added support for multiple commands per key/button mapping; elegant fix for issue #150 2014-07-23 23:41:23 +02:00
Bert Münnich
d26f39914e Use thumbnails in EXIF tags; requirement for libexif is back 2014-06-09 22:59:49 +02:00
Bartłomiej Piotrowski
b901236261 Fix build with giflib >= 5.1.0. 2014-05-27 11:46:42 +02:00
Bert Münnich
e685859a30 Use a checkerboard background for alpha layer; fixes issue #138 2014-04-06 22:47:42 +02:00
Bert Münnich
d049391916 Check for background image allocation failure 2014-02-07 22:57:58 +01:00
Bert Münnich
4fde8c8cbc Use separate background image for alpha layer; fixes issue #132 2014-02-06 22:04:19 +01:00
Bert Münnich
43a04c4757 Revised scale mode and zoom level handling
- Scale mode is not reset to default value upon image loading anymore
- New default key binding to change mode to scale-down
- Removed scale mode setting from config.h
- Removed -d command line option, as this is now the default at startup
2014-02-04 23:03:53 +01:00
Bert Münnich
eb82519a80 Preserve panning when switching images; fixes issue #131 2014-02-04 21:02:02 +01:00
Bert Münnich
002c7e550b Second take at rotating & flipping multi-frame images; fixes issue #121 2014-01-09 20:32:22 +01:00
Bert Münnich
48700aa6c8 Revert "Apply flip & rotation on all frames of a multi-frame image; fixes issue #121"
This reverts commit f795273b65.
2014-01-09 20:24:58 +01:00
Bert Münnich
f795273b65 Apply flip & rotation on all frames of a multi-frame image; fixes issue #121 2014-01-09 00:30:10 +01:00
Bert Münnich
6a0fa2507c Slideshow mode is back, in a simplified version 2014-01-04 19:07:15 +01:00
Bert Münnich
ab28c9a8b9 Refactored remote changes 2013-12-31 16:38:42 +01:00
Aleksander Nitecki
078136d217 Read GIF's repeat information from file. 2013-12-30 23:16:17 +01:00
Bert Münnich
99dfd14919 Fixed Imlib file handle type, issue #117 2013-12-13 13:04:45 +01:00
Bert Münnich
ac2a6ff040 Correct out-of-range gamma values given on command line 2013-11-14 17:12:55 +01:00
Bert Münnich
50f9ad14de Refactored remote changes 2013-11-14 17:06:20 +01:00
András Mohari
0353e6eea2 Add support for changing the gamma value 2013-11-13 20:54:09 +01:00
Bert Münnich
26a624a543 Added options for anti-alias & alpha layer coloring to config.def.h
Also removed now obsolete -p command line option; fixes issue #98
2013-08-22 12:59:05 +02:00
Bert Münnich
56142bd3ba Refactored merged rotation code 2013-08-10 15:55:18 +02:00
Bastien Dejean
7e51c35801 Handle 180 degrees image rotation 2013-08-10 15:33:14 +02:00
Bert Münnich
b1a24cb018 Fixed build for giflib version >= 5.0; fixed issue #90 2013-04-21 13:55:08 +02:00
Bert Münnich
08ae25da22 Refactored function definitions to use dangling brace 2013-02-08 22:05:31 +01:00
Bert Münnich
6d3bbc6d5e Updated/corrected license header 2013-02-08 21:52:41 +01:00
Bert Münnich
eea8b7a98d Fixed compilation with giflib version 4.2.1 2013-01-04 20:55:30 +01:00
Bert Münnich
97a2c05cc3 Fixed issue #74, conditional compilation of gif support 2012-12-27 16:43:19 +01:00
Bert Münnich
5dbf1b8eb9 Smaller minimum gif delay, fixed issue #71 2012-10-29 20:55:55 +01:00
Bert Münnich
c78f55ebb4 Simplified zoomdiff function 2012-08-16 21:21:08 +02:00
Bert Münnich
8a652a786c Corrected zoom level handling 2012-08-16 13:09:44 +02:00
baskerville
b56989f8fb New commands: fit to the window's height/width 2012-07-19 12:28:44 +02:00
Bert Münnich
4c40cc24bc Slightly refactored flipping 2012-05-06 13:02:34 +02:00
baskerville
ba0a5b89fa Added horizontal and vertical flip commands 2012-05-06 09:39:45 +02:00
Bert Münnich
d407dd65d5 Already in the year 2012 2012-02-15 19:16:24 +01:00
Bert Münnich
691c6d7e7e Added own exif tag handling in files exif.[ch] 2012-02-15 19:13:44 +01:00
Bert Münnich
b8458271fb Added text bar on bottom of window 2012-02-12 19:00:41 +01:00
Bert Münnich
ef0ed32264 Removed exif support; made gif support non-optional 2012-02-11 02:42:52 +01:00
Bert Münnich
c3c95ab218 Removed slideshow support 2012-02-11 02:34:18 +01:00
Bert Münnich
d2ec67e331 Fixed issue #32: wrong antialias setting after it_shell_cmd 2011-12-17 16:36:21 +01:00
Bert Münnich
ac4eb53029 Fixed issue #28 (again) 2011-11-13 15:53:09 +01:00
Bert Münnich
92b2779b00 Fixed issue #28 2011-11-11 22:54:20 +01:00
Bert Münnich
3e2523818b Fixed handling of gif disposal method (issue #23) 2011-10-17 18:39:33 +02:00
Bert Münnich
8dcb54705a Fixed pixel-wise panning by chaning x, y vars to float 2011-10-16 18:31:01 +02:00
Bert Münnich
867940ea85 Pan by pixel count, if number prefix given 2011-10-16 17:39:22 +02:00
Bert Münnich
36177fb180 Updated contact information 2011-10-14 10:40:49 +02:00
Bert Münnich
4383a651c7 Strictly adhere to ANSI-C standard 2011-10-13 16:50:06 +02:00
Bert Münnich
4864f04455 Regard gif disposal method; fix bug #18 2011-10-11 20:28:58 +02:00
Bert Münnich
71e61b13b2 Made zoomdiff an inline function 2011-09-29 13:12:40 +02:00
Bert Münnich
8dcf682de9 Made all conditionals more precise 2011-09-29 12:43:36 +02:00
Bert Münnich
22d4e991d5 Transformed function macros in util.h to inline functions 2011-09-29 10:16:13 +02:00
Bert Münnich
d369f10aa5 Fix layering of small gif frames 2011-09-28 12:53:44 +02:00
Bert Münnich
d721d8453e Added STREQ macro 2011-09-26 21:53:52 +02:00
Bert Münnich
515e410451 Use win_t member in img_t & tns_t instead of parameters 2011-09-17 17:23:51 +02:00
Daniel
82df0b34e9 270/90 = 3 2011-09-14 19:28:44 +02:00
Bert
dad06c7561 Much nicer handling of compile-time features
- *_SUPPORT enabled in config.h
- XLIBS helper app prints lib flags needed for current settings
2011-09-12 19:28:02 +02:00
Bert
b2a2a62b7b Added own bool type 2011-09-11 21:01:24 +02:00
Bert
e2d4b9c791 Added dirty flag to img struct 2011-09-11 01:13:45 +02:00
Bert
510512714d Added slideshow support 2011-09-10 18:41:20 +02:00
Bert
6e575b0f72 Strict conformance to IEEE Std 1003.1-2001 2011-09-08 20:54:24 +02:00
Bert
fdbc5cf76b Added EXIF_SUPPORT macro for optional dependency on libexif 2011-09-08 15:58:30 +02:00
Bert
bfab4dc328 Added EXIF auto-orientation 2011-09-08 15:57:44 +02:00
Bert
b96c106337 Overhauled building
- config.h -> config.def.h
- Create config.h during make, if it does not exist
- Nice make output
- Use XFLAGS and XLIBS to include additional compile-time features,
  which depend on third-party libraries
2011-09-08 15:41:18 +02:00
Bert
8f34b7e95c Load as much of a corrupted gif file as possible 2011-09-06 11:55:31 +02:00
Bert
14d1daf280 Removed useless zl_cnt variable 2011-09-06 11:04:47 +02:00
Bert
d585b86354 Reformated license header 2011-09-03 23:11:45 +02:00
Bert
de6b58a315 Unified feature test macro requirements 2011-09-03 14:22:06 +02:00
Bert
391e6e7079 Mention origin of img_load_gif() in comment 2011-08-20 13:07:36 +02:00
Bert
bb577d274d Added command to toggle gif animations 2011-08-19 18:46:17 +02:00
Bert
8b3ae5027e Added support for gif animation 2011-08-19 15:22:16 +02:00
Bert
a4b90aee20 Added HAVE_GIFLIB macro for optional dependency on giflib 2011-08-19 15:12:30 +02:00
Bert
79bd86defb Refactored img_load_gif()
- Corrected handling of transparency settings for individual frames
- Corrected handling of different frame dimensions & offsets
2011-08-19 15:12:30 +02:00
Bert
86a6f00112 Added support for multi-frame images 2011-08-19 15:12:30 +02:00
Bert
8763f6930f Corrected FSF address in license headers 2011-08-18 01:18:26 +02:00
Bert
ff013dd009 Revised handling of file names & paths 2011-08-18 00:38:55 +02:00
Bert
2b7192b1ac Renamed scroll() to pan_screen() 2011-08-05 10:17:36 +02:00
Bert
b8ff1677b1 Major code refactoring
- Configurable key and mouse mappings in config.h
- Put event handling code from main.c into events.[ch]
2011-07-26 18:01:29 +02:00
Bert
a271e16744 Reduced usage of preprocessor macros 2011-07-22 14:49:06 +02:00
Bert
a6100373c1 New mappings: ctrl-[hjkl], pan image one window width/height 2011-06-03 23:39:22 +02:00
Bert
485e6c863a H/J/K/L mappings to pan to edges 2011-05-16 15:54:09 +02:00