#993029 ranger: No preview for mp(e)g files (mime-type: image/x-tga) and fs saturation with .pam files #993029
- Package:
- imagemagick-6.q16
- Source:
- imagemagick
- Description:
- image manipulation programs -- quantum depth Q16
- Submitter:
- l0f4r0
- Date:
- 2021-11-11 15:18:04 UTC
- Severity:
- important
Dear Maintainer,
When preview_images is activated (at least with method:w3m on my
xfce4-terminal), hovering an mpg/mpeg file leads to a saturation of my
filesystem because /tmp becomes full of "magick-*.pam" huge files.
Moreover, preview itself doesn't succeed (ranger tries with no avail,
there is an infinite 'rolling cross /-\|' icon preview on the upper
right corner).
When that happens, I have no other choice but to cancel the preview task and remove
those temporary .pam files.
I don't have enough mp(e)g or image/x-tga files on my computer to do exhaustive tests. Maybe
more extensions are impacted by this bug.
I think the issue is related to the imagemagick functions (typically
`identify`) in ranger scope.sh (see `handle_image()` definition).
Indeed `identify` doesn't seem to work on my mp(e)g video files.
That's why I've added the following lines after `case ${mimetype}` in my scope.sh (before `image/*)`):
image/x-tga)
exit 1;;
This way, there is no preview anymore for those problematic files, hence
no issue.
However I would prefer having a preview for sure...
NB: I've set the severity to "critical" because there is an impact on
the whole filesystem (many resulting problems arise when an fs is full).
For instance, .mp4 files work correctly for me. Thanks in advance
Maybe my few .mp(e)g files should not be recognized as "image/x-tga" but something more appropriate as "video/mpg" or "video/x-mpeg" at the very first place? In this case, it's probably not a ranger bug but just my files which are corrupted/malformed... What do you think about it please?
What's the status of this bug right now? Have we notified upstream? Abraham Raji
@l0f4r0 Can you still reproduce this issue? Is it still present in latest upstream tagged version (ie. v1.9.3 [1])? Is it still present in latest version from git master branch [2]? [1]: https://github.com/ranger/ranger/releases/tag/v1.9.3 [2]: https://github.com/ranger/ranger
@Arnaud: I confirm, this issue still exists on v1.9.3.
NB: Regarding git master branch now, see below, I cannot launch ranger.py:
$ ./ranger-master/ranger.py
ranger version: ranger-master 1.9.3
Python version: 2.7.16 (default, Oct 10 2019, 22:02:15) [GCC 8.3.0]
Locale: None.None
Traceback (most recent call last):
File
"/home/l0f4r0/Téléchargements/ranger-master/ranger-master/ranger/core/main.py",
line 122, in main
load_settings(fm, args.clean)
File
"/home/l0f4r0/Téléchargements/ranger-master/ranger-master/ranger/core/main.py",
line 489, in load_settings
fm.source(custom_conf)
File
"/home/l0f4r0/Téléchargements/ranger-master/ranger-master/ranger/core/actions.py",
line 388, in source
self.notify('Error in line `%s\':\n %s' % (line, str(ex)), bad=True)
File
"/home/l0f4r0/Téléchargements/ranger-master/ranger-master/ranger/core/actions.py",
line 179, in notify
text = str(obj)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 28: ordinal not in range(128)
Hi, This bug does not belong to ranger. ranger called `identify` from imagemagick on the given video, and identify ends up creating a bulky magick-*.pam file under /tmp and exiting with error. I can reproduce this problem on stable with some of my local video files: lumin ~/Videos> identify xxx.mp4 identify-im6.q16: delegate failed `'ffmpeg' -nostdin -v -1 -i '%i' -vframes %S -vcodec pam -an -f rawvideo -y '%u.pam' 2> '%u'' @ error/delegate.c/InvokeDelegate/1966. It only quit when there is no space in /tmp anymore.