jhawthorn / meh Goto Github PK
View Code? Open in Web Editor NEW:rice_scene: a simple, minimalist, super fast image viewer using raw XLib
Home Page: http://www.johnhawthorn.com/meh/
License: MIT License
:rice_scene: a simple, minimalist, super fast image viewer using raw XLib
Home Page: http://www.johnhawthorn.com/meh/
License: MIT License
meh 0.3 John Hawthorn ([email protected]) --- Installation To compile type make To install type make install Installation prefix can be changed by the PREFIX variable make install PREFIX=/usr default prefix is /usr/local Configuration can be changed in config.mk --- Copyright (c) 2008-2009 John Hawthorn 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 or substantial portions of the Software. 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 OR COPYRIGHT HOLDERS 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. ---
The test suite crashes at scale.c:175
in nearestscale
. The reason seems to be the way nearestscale
is invoked:
nearestscale(&img, 1280, 1024, 1280, to);
In nearestscale
, width
and bytesperline
are the same which causes jdy
to be negative -- or rather, since it's unsigned, positive and very large. At the end of the first outer loop it gets added to newBuf
, causing a segfault on the next access to newBuf
at line 175.
With all the API changes in Giflib, it's a pain to make meh 0.3 compile properly.
Do you think it's time to release meh 0.4?
Thanks!
I have a view DICOM files which imagemagick can show with display, meh fails to do so.
They have no file-ending, but file identifies them as
MR000000: DICOM medical imaging data
and identify identifies them as
MR000000 DCM 320x320 320x320+0+0 8-bit sRGB 280KB 0.000u 0:00.000
Didn't try it with other formats thought since I was too lazy to search for unsupported formats other than this
Just tried out meh and I really dig its speed! Don't you think left and right cursor keybindings would make it more user-friendly?
after cloning meh from git and typing 'make' rather than making it gives this error:
`% make
cc -O3 -DNDEBUG -MMD -MP -MT "src/bmp.d" -c -o src/bmp.o src/bmp.c
In file included from src/bmp.c:5:
src/meh.h:50:15: error: unknown type name 'fd_set'
int setup_fds(fd_set *fds);
^
src/meh.h:51:17: error: unknown type name 'fd_set'
int process_fds(fd_set *fds);
^
2 errors generated.`
Steps to reproduce:
meh imageFile
pgrep meh
Pressing q on the active opened image closes process properly.
Strangely xprop doesn't register any unique details on opened images:
(attaching this because it might be the reason why kill command cannot end running process due to missing pid?)
_NET_WM_DESKTOP(CARDINAL) = 1
_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
WM_NORMAL_HINTS(WM_SIZE_HINTS):
On my system I needed to add #include <sys/select.h> to meh.h for fd_set when compiling with musl-libc.
I've added directory support where you can
meh my-dir
and you can navigate with the arrow keys normally through all
images in that directory.
Do you want me to polish the code a bit and submit a patch request ?
This image viewer is amazing: Extremely fast and very nice to use from the command line!
However, it doesn't seem to let one control the image zoom, except by resizing the containing window, as it seems to always scale the image to fit the window. For very large images (lmuch arger than the screen resolution), this is very inconvenient. For images of other sizes, it would still be nice to have.
Following the spirit of meh, the way to go is probably to keep this functionality out of meh itself and doing something like
meh * | xargs -I___ mogrify -scale -10% ___
# Note that this code doesn't work, it's just to show the idea: Hitting
# enter should scale down the image.
# Note also that this, provided it worked like intended, would
# permanently scale the actual image file, instead of just zooming
# the display. This shouldn't be hard to work around, though.
However, this way we only get one-way zoom, and as there is just one STDOUT, I don't see an obvious way to trigger two (or more) different commands for zooming in and out. Maybe if meh hat an option to write to one of several (named) pipes, depending on keystroke? Not sure about that, but then I don't know much about pipes.
Another idea: Hitting a number key could output the image filename (like with enter) plus the respective number (after a whitespace). Then the command behind the pipe could decide on what to do depending on which number it received along with the filename.
Or maybe Ctrl plus any symbol key could act like that? Then this wouldn't be restricted to just the number keys (but to always holding the Ctrl key...).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.