惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
W
WeLiveSecurity
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
Security Affairs
SecWiki News
SecWiki News
T
Tenable Blog
C
CERT Recently Published Vulnerability Notes
Forbes - Security
Forbes - Security
Google Online Security Blog
Google Online Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
T
Threat Research - Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
PCI Perspectives
PCI Perspectives
Engineering at Meta
Engineering at Meta
博客园 - 聂微东
Cyberwarzone
Cyberwarzone
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
V
Vulnerabilities – Threatpost
宝玉的分享
宝玉的分享
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
V
Visual Studio Blog
T
Threatpost
Project Zero
Project Zero
Know Your Adversary
Know Your Adversary
I
InfoQ
G
Google Developers Blog
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
T
The Blog of Author Tim Ferriss
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
O
OpenAI News
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tor Project blog
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 三生石上(FineUI控件)
D
DataBreaches.Net
Security Latest
Security Latest
Attack and Defense Labs
Attack and Defense Labs
aimingoo的专栏
aimingoo的专栏
H
Heimdal Security Blog

Hub's wlog

Hub's wlog - Dia with GTK 3 Hub's wlog - Dev Log August 2023 Hub's wlog - libopenraw Rust with C API Hub's wlog - Niepce July 2023 updates Hub's wlog - Life update Hub's wlog - Niepce May 2023 updates Hub's wlog - Niepce April 2023 updates Hub's wlog - Niepce March 2023 updates Hub's wlog - Integrating the RawTherapee engine Hub's wlog - Niepce February 2023 updates Hub's wlog - Implementing i18n-format, a Rust procedural macro Hub's wlog - Niepce January 2023 updates Hub's wlog - i18n-format for Rust Hub's wlog - Introducing Toot That! Hub's wlog - Niepce December 2022 updates Hub's wlog - Niepce November 2022 updates Hub's wlog - Fall of releases Hub's wlog - Introducing Compiano Hub's wlog - RTKit, portals, and Pipewire Hub's wlog - Release day Hub's wlog - Update on Niepce Hub's wlog - New Again
Hub's wlog - Niepce June 2023 updates
:: Hubert Figuière · 2023-07-01 · via Hub's wlog

2023.07.01

This is the June 2023 update for Niepce.

The importer

Back where we left, still working on the import.

It looks like there is more work than anticipated to be able to import a tree a files.

The database model

The database model was designed a while ago, when some of the concepts I had in mind weren't clear enough. So this needs to be fixed. First I need to make folders unique on the parent and the name. With the current design a folder is a physical directory on the filesystem, which is way simpler than the idea I had. Since updating the database schema also mean upgrading, I took the opportunity to make keywords unique on the keyword and parent (they are in a hierarchical organisation too).

File management

Since the inception I had the plan to have two kinds of way to "store" image imported. Managed and mot managed. Managed meant that the file would be "owned" by the library, copied into a location controlled by the app. Not managed meant it's just a reference to a file on the filesystem. This concept idea came from Apple Aperture™ that did just that, where you'd have a library occuping dozens of GB on your disk. The storage layout of the files was abstracted.

Instead I decided to simplify the approach. Importing files will by default reference, or will copy into a specific location (when importing from a camera, only the latter). The folders are actual directories in storage and this goes hand in hand with the recursive import.

So I just ripped out the Managed enum wherever it was used and ignored. This was unfortunately ported from the C++ code a while ago.

UI bug

Of course this look like an onion I peel, with each layer that make me cry. This one is a crash in the GTK code, but it was triggered by a bad algorithm causing an attempt to load an item out of the array bounds. Part of the fix is to use #[must_use] for the container associated function to prevent ignoring the result. The gorry detail is that the (custom) container push() associated functions returns the old item if it is being replaced. It happen that the code assumed the len() increased all the time. Forcing to check the return value guards (with a warning) that the result not get ignored, and in that case properly handling the container size.

The result

The main patch got merged. It adds a recursive flag to the file import UI, and update the copy_importer example that I use for manually testing. From a storage standpoint it works:

select * from folders;
1||Trash|0|1|1|0|0
32|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022|2022|0|0|0|0|0
33|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220814|20220814|0|0|0|0|32
34|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220815|20220815|0|0|0|0|32
35|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220816|20220816|0|0|0|0|32
36|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220817|20220817|0|0|0|0|32
37|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220819|20220819|0|0|0|0|32
38|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220820|20220820|0|0|0|0|32
39|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220821|20220821|0|0|0|0|32
40|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20220824|20220824|0|0|0|0|32
41|/var/home/hub/Pictures/Camera import 2023-04-09 004747/2022/20221031|20221031|0|0|0|0|32

The last column is the parent_id that reference id, the first column. So the hierarchy is here.

However the UI is still not doing it:

Workspace

All the folder items should be below the 2022 folde while here they are on the same level. Note the disclosure triangles are a limitation of GtkListView.

What's next

Definitely I need to finish the UI. Some bugs are left and as well as the UI to pick the destination folders in the import dialog.

Also needing fixing is the display hierarchical keyword, I already did some work for it with the database schema update.

Thanks you for reading.