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

推荐订阅源

S
Secure Thoughts
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Heimdal Security Blog
SecWiki News
SecWiki News
H
Hacker News: Front Page
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
AI
AI
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
PCI Perspectives
PCI Perspectives
S
Securelist
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
Forbes - Security
Forbes - Security
T
Tor Project blog
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
I
Intezer
Martin Fowler
Martin Fowler
Help Net Security
Help Net Security
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Cisco Talos Blog
Cisco Talos Blog
Latest news
Latest news
博客园 - 司徒正美
W
WeLiveSecurity
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
P
Palo Alto Networks Blog
Google DeepMind News
Google DeepMind News
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
V
Vulnerabilities – Threatpost
Jina AI
Jina AI
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Simon Willison's Weblog
Simon Willison's Weblog
Project Zero
Project Zero
T
Threatpost
P
Privacy International News Feed
人人都是产品经理
人人都是产品经理
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research

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.