On a BitLocker-Drive certain image types won't load when NTFS-compressed
Setup (please complete the following information):
- Distribution: Ubuntu
- Distribution release: 22.04.2 LTS
- Geeqie version: Geeqie 1.7.2 GTK3
Describe the bug when trying to access any images of certain image types (see "Image sources" for a list) on a "BitLocker 2"-Drive [edit: with activated NTFS-compression], geeqie shows the "sheet_broken.svg" instead of the image.
To reproduce In Windows, create a Bitlocker Partition, with several image files on it. [edit: Activate NTFS-compression for these files Properties: ->"Advanced..." -> "Compress contents to save disk space"]
In Ubuntu, unlock your Bitlocker Partition to mount it (the usual way through Files or Disks, as virtual ntfs drive), then open your images with geeqie. Note: The same image files are accessible with geeqie if the drive they're on isn't Bitlocker-encrypted.
Screenshots
Image sources If applicable, upload image files causing the bug. (Use gzip)
Really any to test. What shows a broken thumbnail: .jpg .png .webp .bmp .gif (with just 1 frame) .dng .ico .svg
What shows the picture: .CR2 .ARW .NEF .gif (with more than 1 frames)
Error logs or seg. fault files
logs in comparison (left side loading normally, bitlocker on the right diverging with "image start error"):
Additional context apt list --installed: [...] libcryptsetup12/now 2:2.4.3-1ubuntu1.1 amd64 [installed,local] libntfs-3g89/jammy-security,now 1:2021.8.22-3ubuntu1.2 amd64 [installed,automatic] ntfs-3g/jammy-security,now 1:2021.8.22-3ubuntu1.2 amd64 [installed,automatic] fuse3/jammy,now 3.10.5-1build1 amd64 [installed,automatic] gvfs-fuse/now 1.48.2-0ubuntu1 amd64 [installed,local] libfuse2/jammy,now 2.9.9-5ubuntu3 amd64 [installed] libfuse3-3/jammy,now 3.10.5-1build1 amd64 [installed,automatic] libsquashfuse0/jammy,now 0.1.103-3 amd64 [installed,automatic]
Using the Alternative driver "dislocker" has not been tried yet: dislocker (fuse) https://github.com/Aorimn/dislocker guide https://itsfoss.com/mount-encrypted-windows-partition-linux/ Additional GUI zenity Dislocker https://github.com/raryelcostasouza/zDislocker
Using Windows 10, I created a BitLocker partition on a 4GB flash drive and copied a single jpeg to it. I plugged the flash drive into a Xubuntu system - all works as expected.
Could you try something equally trivial as a test?
For sanity I experimented some more. Can you follow?
(In Windows: Right Click on the single jpeg) Properties: ->"Advanced..." -> "Compress contents to save disk space"
OK, Windows will not compress a file on a flash drive. I used a rotating drive for tests.
The latest release, v2.5, works with compressed NTFS files. Anything before that does not. I do not know why.
I might try to try to identify the commit that solves the problem, but maybe that is not so important right now.
Until you update your system, the possibilities are: Compile from sources: https://github.com/BestImageViewer/geeqie - Compiling and Installing Flatpack: https://flathub.org/apps/org.geeqie.Geeqie AppImage: https://github.com/BestImageViewer/geeqie/releases/tag/continuous
[AppImages are the least disruptive to your system until you can get the latest version in the distribution you use]
the commit that solves the problem:
commit 437b050192b25c346253482a03e3ffd13a836320 Author: Arkadiy Illarionov [email protected] Date: Sat Aug 24 14:12:21 2024 +0300
Deduplicate file mapping
src/image-load-libraw.cc | 28 ++++------------------------
src/image-load.cc | 30 +++---------------------------
src/ui-fileops.cc | 23 +++++++++++++++++++++++
src/ui-fileops.h | 2 ++
4 files changed, 32 insertions(+), 51 deletions(-)
Thank you for your guidance. I compiled v2.5 from source and it does work for me.
However if I check the console running geeqie, for each file it shows <absolute-path><filename>: Operation not supported.
I think this error message is related to this issue , because it only does so on mentioned drives.
However if I check the console running geeqie, for each file it shows
<absolute-path><filename>: Operation not supported.
I do not see this error when running the latest sources. I think this message is from the system, and not from Geeqie.
The origin of the problem is this line of code:
il->mapped_file = static_cast<guchar *>(mmap(nullptr, il->bytes_total, PROT_READ|PROT_WRITE, MAP_PRIVATE, load_fd, 0));
Using the PROT_WRITE option on compressed NTFS files results in a errno 95 which generally means "Operation not supported"`
When @qarkai revised the code, that option was removed - presumed unnecessary.
See #991
geeqie shows the "sheet_broken.svg" instead of the image
BTW can we use icon from system theme? Freedesktop Icon Naming Spec has image-missing entry.
BTW can we use icon from system theme? Freedesktop Icon Naming Spec has image-missing entry.
I guess so, but I have no understanding of the details of this...
I researched a little. It turns out that geeqie uses gq-icon-broken as pixbuf, not an icon. It is possible to get pixbuf by icon name in Gtk3 using gtk_icon_theme_load_icon() but gtk_icon_theme_load_icon() is gone in Gtk4. So I guess we continue to use gq-icon-broken.