narcoticfresh/shotwell
Composer 安装命令:
composer require narcoticfresh/shotwell
包简介
A PHP library providing a simple API to a Shotwell (the default Ubuntu image manager) sqlite database.
README 文档
README
This is a simple PHP library for dealing with Shotwell (the default photo manager in Ubuntu) sqlite databases.
Basic stuff
Why does it exist?
I'm using Shotwell for my pictures and videos (having a huge collection) and I think it's superb!
I found myself in need to use the data stored in the Shotwell database (that btw usually resides in ~/.local/share/shotwell/data/photo.db) to script some stuff (like tagging video files with the tags I've given in Shotwell - a thing that it doesn't seem to be able to do).
Being initially pleased that all the data I accumulated is an an re-usable format (a SQLite database), I quickly became puzzled with the structure of that said database. The storage of the different media types (video/photo) and the relations are rather unusual.
To make matters simpler, this small library was created.
Is it fully featured?
No. It's a simple thing that hides some Shotwell internal complexity and then gives back plain arrays of the database content.
I didn't need more - I thought about creating custom Models to represent the data structures, but it doesn't make any sense. Also, only the functions I needed (mostly in regard to basic manipulations and tagging) are implemented.
Why is it here?
It's only here because I needed the library on more than one of my private projects. To make that dependency stuff easier, it had to go on Packagist so it had to go somewhere. So that somewhere is here.
Installation
Just use composer, see the Packagist page.
Require it like this:
composer require narcoticfresh/shotwell
Usage example
<?php // make sure composer autoloader is there require_once 'vendor/autoload.php'; $shotwell = new \Narcoticfresh\Shotwell\Api('/home/user/.local/share/shotwell/data/photo.db'); // get everything $items = $shotwell->getAll(); // get only photos $items = $shotwell->getAllPhotos(); // get only videos $items = $shotwell->getAllVideos(); // get by a tag $items = $shotwell->getItemsByTag('diving'); // get all tags $tags = $shotwell->getAllTags(); // set tag on an object $shotwell->setItemTags('my-object-id', ['tag1', 'tag2']); // set item rating $shotwell->setItemRating('my-object-id', 3);
There are more functions, just check the class file..
narcoticfresh/shotwell 适用场景与选型建议
narcoticfresh/shotwell 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 06 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 narcoticfresh/shotwell 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 narcoticfresh/shotwell 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2016-06-12