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

推荐订阅源

N
Netflix TechBlog - Medium
N
News and Events Feed by Topic
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
Cisco Talos Blog
Cisco Talos Blog
Hacker News: Ask HN
Hacker News: Ask HN
Simon Willison's Weblog
Simon Willison's Weblog
W
WeLiveSecurity
H
Hacker News: Front Page
L
LINUX DO - 热门话题
T
Tor Project blog
N
News | PayPal Newsroom
S
Secure Thoughts
小众软件
小众软件
Recent Commits to openclaw:main
Recent Commits to openclaw:main
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
AWS News Blog
AWS News Blog
Security Latest
Security Latest
MyScale Blog
MyScale Blog
Webroot Blog
Webroot Blog
Cyberwarzone
Cyberwarzone
Engineering at Meta
Engineering at Meta
腾讯CDC
T
Tailwind CSS Blog
SecWiki News
SecWiki News
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
P
Palo Alto Networks Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog RSS Feed
大猫的无限游戏
大猫的无限游戏
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
GbyAI
GbyAI
C
Check Point Blog
博客园_首页
PCI Perspectives
PCI Perspectives
月光博客
月光博客
TaoSecurity Blog
TaoSecurity Blog
aimingoo的专栏
aimingoo的专栏
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家

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.