34 Commits

Author SHA1 Message Date
Jamie Pine
c85798ddcf Fix image dimension scaling documentation 2025-12-10 14:41:20 -08:00
Jamie Pine
b4024c860e Mobile app in React Native
+ validation support for Actions
2025-12-05 15:16:41 -08:00
Jamie Pine
9acf86a9ea Add location export/import and schema changes 2025-11-30 17:27:31 -08:00
Arnab Chakraborty
dcb78f079e Working Sync & Thumbnail Sync (#2875)
* First draft on new p2p design

* Test sync

* Sync works

* Update version

* Fix merge conflicts

* More stuff for thumbnail sync

* Get the thumbnail

* Update mod.rs

* Working thumbnail sync

* Format

* Update thumbnails.rs

* Update runner.rs

* Update runner.rs

---------

Co-authored-by: Ericson Soares <ericson.ds999@gmail.com>
2025-03-20 07:34:59 +03:00
Vítor Vasconcellos
eb098ebec2 Update iroh and sd-cloud-schema
- Fix usage of deprecated functions
 - Implement clippy beta suggestions
2024-10-21 19:44:08 -03:00
James Pine
0ac05f46b3 increase max file size for thubm generation 2024-10-12 00:59:27 -07:00
Vítor Vasconcellos
cdc50140b0 [ENG-1928] Update to tauri 2.0.1 stable (#2752)
* Update to tauri 2.0.0 stable
 - Update a some othe dependencies
 - Autoformat rust and toml files

* Fix clippy complain

* Update tauri 2.0.1
 - Update rspc
 - Update some frontend files due changes in rspc
 - Update some frontend build dependencies

* Revert babel update

* Fix code typing typing and style + a couple of bugs

* More type fixes
2024-10-05 21:17:30 +00:00
Consoli
8ce9f30121 Remove dependency on once_cell and use std types (#2746)
* Remove dependency on once_cell and use std types

* Bump MSRV across the project to 1.81

* Cargo fmt

* Update rust-toolchain to 1.81
2024-09-30 21:19:59 +00:00
Consoli
874a268735 Update pdfium-render version (#2701)
* Revert "Fix pdf thumbnails (#2666)"

This reverts commit c240047e0538f72a572fdf16f5143edf11bf1894.

* Bump pdfium-render dep

* Bring back custom fork
 - Bump the minimum pdfium lib api version (updated bundled lib in native-deps)
 - Custom fork is still required because upstream added a hard limit on chono version 0.4.31, which is incompatible with some of our dependencies which require newer versions

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
2024-09-17 14:44:03 +00:00
Vítor Vasconcellos
c240047e05 Fix pdf thumbnails (#2666) 2024-08-16 21:19:19 +00:00
Vítor Vasconcellos
df1f503867 Remove unused code and update rust deps (#2662)
* Remove deps-generator app
 - It is broken for quite a while and not being used

* Remove unused code and unused deps

* auto format

* Restore incorrectly removed files
 - Remove aws deps and test code using it

* Replace winapi-util with windows-rs
 - Adjust some deps versions

* Autoformat

* Update rand, remove unused dep

* Fix image crate due to changes in pdf-renderer
 - Dont use default features in reqwest
 - Use native-tls tauri

* Remove incorrect notice about blake3
2024-08-15 17:09:03 +00:00
Arnab Chakraborty
8cfbd374e3 [ENG-1854] Migrate to Tauri v2 Release Candidate (#2654)
* Migrate to Tauri v2 Release Canidate

* Formatting

* Update pnpm

* Update all tauri deps (js and rust) to Release Candidate 2
 - A lot of misc fixes due to changes in the new versions of tauri, rspc and specta

* Recreate pnpm-lock

* Fix pnpm-lock

* Formatting

* Use 10 chars SHA for git deps
 - Update a couple of rust dependencies
 - Add taplo for toml auto formatting
 - Adjust some formatting configurations
 - Updated prettier and its plugins

* Fix formatter settings

* Minor improvements to Cargo.toml format

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
2024-08-14 18:22:46 +00:00
Ericson "Fogo" Soares
2d19fad2eb [ENG-1793] Introduce error handling for sd-core-sync crate (#2556)
* Error handling for sd-core-sync crate
Also a bunch of tweaks and fixes

* Update core.ts

* Auto format

* Comment out background_processing_percentage on frontend too
 - Update rust version in contributing

* Trying to avoid data loss on actor stop

* Stronger linter on sync generator

* Stronger lint on sync subcrate

* Clean back tasks.json file

* TS typechecking

* Autoformat

* Add more verbose errors for Cloud REST API

* Removing some comments

Copilot is fun sometimes lol

* Properly stopping actors

* Fix ingest stop

* Racing on stop for actors

* Error conversion from merge with main

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
Co-authored-by: Arnab Chakraborty <11457760+Rocky43007@users.noreply.github.com>
2024-07-16 22:30:35 +00:00
Vítor Vasconcellos
c0540b343d Clean up and update rust dependencies (#2544)
* Clean up and update rust dependencies

* Attempt to fix Windows Error
2024-06-10 19:44:00 +00:00
jake
6761980503 Clippy the entire repo (#2195)
* fix(clippy): for the entire repo

* fix: make function non-const fn
2024-03-12 11:27:23 +00:00
jake
321df503c6 [ENG-1668] Update resvg and related code (#2177)
deps: update `resvg` and related code
2024-03-07 18:22:04 +00:00
Ericson "Fogo" Soares
71e7159f09 [ENG-1627] Move all jobs and actors to an "Old" namespace (#2157)
* Bunch of new warns due to a stronger clippy config

* Moving old processing stuff to a new namespace
Also fixing a bunch of typos through the entire codebase.

* Rustfmt
2024-03-04 18:57:35 +00:00
Ericson "Fogo" Soares
8af3a5f286 [ENG-1479] AI Prototype (#1845)
* First draft on image labeling

* Fixing execution providers for other OSs

* Better error handling and shutdown

* Working with shallow media processor

* bruh

* Fix warnings

* Now hooked to media processor job

* Link desktop app with libonnxruntime to avoid TLS error during startup

* Be able to change models on runtime
Revert to use labels table instead of tags

* A bug on a model-less inference

* Show AI labels on Inspector
 - Change yolo inference to use half precision
 - Add labels api to core

* Remove LD_PRELOAD

* Fix race condition on model executor shutdown

* Don't load all images in memory moron

* Embeed yolo model in prod build
 - Change yolo model path to new one relative to executable

* Disable volume watcher on linux, it was crashing the app
 - Invalidate labels when they are updated

* Rust fmt

* Minor changes

* Gate onnxruntime linking to the ai-models feature

* Add build script to sd-server to handle onnxruntime linking workaround

* Move AI stuff to its own crate and normalize deps

* Rust fmt

* Don't regenerate labels unless asked to

* Now blazingly fast

* Bad merge

* Fix

* Fix

* Add backend logic to download extra yolo models

* Add models api route
 - Add api call to get available model version
 - Add api call to change the model version

* Improve new model download logic
 - Add frontend to change image labeler model

* Fix new model downloader

* Fix model select width

* invalidate labels count after media_processor generates a new output

* Rename AI crate and first draft on download notifications

* fix types

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-19 09:28:57 +00:00
Vítor Vasconcellos
7a456bfc9c [ENG-1471] Fix PDF transparent background (#1844)
Fix PDF transparent background
2023-12-01 00:20:09 +00:00
Vítor Vasconcellos
df88c28b26 Fix pdf thumbs having incorrect colors (#1826)
Fix BGR being interpreted as RGB when generation pdf thumbs
 - Disabled some pdf render configs for better performance
2023-11-25 05:09:40 +00:00
jake
ea1e4d748a [ENG-1095] HEIF* and PDF thumbnail orientation (#1815)
* fix horizontal pdf rendering

* don't rotate certain formats (heif*)

* return `u32` from scaling function

* add `avifs` as a valid extension

* add avifs as a valid MIME type

* re-categorize `avifs` as a video (sequence)

* Fix mime-types

* Add Hif extension
 - Cannon uses a special extension for heif in its cameras: https://github.com/digipres/digipres.github.io/blob/master/_sources/registries/fdd/fddXML/fdd000525.xml#L213-L221

* hif is actually a heic

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
2023-11-24 22:07:25 +00:00
Vítor Vasconcellos
26a31ce15e Fix some possible pdf thumb rendering concurrency bugs (#1809) 2023-11-23 19:38:17 +00:00
Vítor Vasconcellos
48afea5a4b [ENG-1184, ENG-1286, ENG-1330] Rework native dependencies (+ deb fixes) (#1685)
* Almost working

* Downgrade libplacebo
 - FFMpeg 6.0 uses some now removed deprecated functions

* Use -Oz for zimg

* Fix CI script to run the new ffmpeg build script

* Fix heif step name + Ignore docker cache while building in CI

* Fix Opencl build on linux

* Fix adding incorrect -target argument to linker
 - Update zig for windows target

* Disable opengl for ffmpeg, it only uses it as an outdev, not for processing
 - Disable opengl and directx for libplacebo, ffmpeg only supports vulkan when using it
 - Add WIN32_LEAN_AND_MEAN to global cflags to optimize windows api usage
 - Fix 99-heif.sh incorrect bsdtar flag

* Remove WIN32_LEAN_AND_MEAN from global CFLAGS as that was breaking OpenCL build
 - Fix Dockerfile step for cleaning up the out dir
 - Improve licensing handling

* x86_64 windows and linux builds are working

* Fix aarch64 build for windows and linux

* Fix symbol visibility in linux builds
 - Fix soxr failing to download due to sourcefourge
 - Only patch zimg on windows targets
 - Tell cmake to hide libheif symbols

* Fix Linux .so rpath
 - Add lzo dependency
 - Publish source for the built libs
 - Add warning for missing nasm in tauri.mjs
 - Remove ffmpeg install from setup.sh
 - Add download logic for our linux ffmpeg bundle in preprep.mjs

* Remove jobs, docker doesn't support this

* Fix typing

* Change ffmpeg references to native deps
 - Rename FFMpeg.framework to Spacedrive.framework
 - Centralize the macOS native deps build with the windows and linux one
 - Change the preprep script to only download our native deps
 - Remove old macOS ffmpeg build scripts

* Compress native deps before creating github artifact
 - The zip implementation for github artifact does not mantain symlinks and permissions
 - Remove conditional protoc, it is now always included

* Don't strip dylibs, it was breaking them
 - Only download macOS Framework for darwin targets
 - Fix preprep script
 - Improve README.md for native-deps
 - Fix not finding native-deps src

* Attempt to fix macOS dylib

* Fix macOS dylibs
 - Replace lld.ld64 with apple's own linker
 - Add stages for building apple's compiler tools to use instead of LLVM ones

* Ensure sourced file exists

* All targets should build now
 - Fix environment sourcing in build.sh
 - Some minor improvements to cc.sh
 - Fix incorrect flag in zlib.sh
 - Improve how -f[...] flags are passed to compiler and linker
 - Add more stack hardening flags

* We now can support macOS 11.0 on arm64

* Improve macOS Framework generation
 - Remove installed unused deps
 - Improve cleanup and organization logic in Dockerfile last step
 - Move libav* .dll.a to .lib to fix missing files in windows target
 - Remove apple tools from /srv folder after installation to prevent their files from being copied by other stage steps
 - Create all the necessary symlinks for the macOS targets while building
 - Remove symlink logic for macOS target from preprep.mjs

* Remove native-deps from spacedrive repo
 - It now resides in https://github.com/spacedriveapp/native-deps
 - Modify preprep script to dowload native-deps from new location
 - Remove Github API code from scripts (not needed anymore)
 - Add flock.mjs to allow running tauri.mjs cleanup as soon as cargo finishes building in linux

* Handle flock not present in system
 - Allow macOS to try using flock

* Fix preprep on macOS

* Add script that patch deb to fix errors and warnings raised by lintian

* Fix ctrl+c/ctrl+v typo

* Remove gstreamer1.0-gtk3 from deb dependencies

* eval is evil

* Handle tauri build release with an explicit target in fix-deb.sh

* Preserve environment variables when re-executing fix-deb with sudo

* Only execute fix-deb.sh when building a deb bundle

* Improvements fix-deb.sh

* Improve setup.sh (Add experiemental alpine support)
2023-11-17 19:20:14 +00:00
jake
367a2bc71a [ENG-1026] Full Disk Access (#1778)
* basic FDA start

* FDA checks and prompt

* lockfile

* misc clippy

* Some small warnings

---------

Co-authored-by: Ericson Fogo Soares <ericson.ds999@gmail.com>
2023-11-15 19:59:50 +00:00
Vítor Vasconcellos
96cda576bc [ENG-1359] Revert "Fix pdf thumb crashing app (#1460)" (#1766)
Revert "[ENG-1220] Fix pdf thumb crashing app (#1460)"

This reverts commit 9be7d93e98e39cc42b341aec77ec453db4673c55.
2023-11-12 22:47:10 +00:00
Oscar Beaumont
73687fd2bd [ENG-1399] Upgrade Rust workspace + IPv6 mDNS (#1729)
Upgrade Rust workspace + IPv6 mDNS
2023-11-04 10:20:22 +00:00
Vítor Vasconcellos
b78f8726ca Enable thumbnail support for webp images (#1634)
* Enable thumbnail support for webp images

* Remove webp optional dep from sd-images crate
2023-10-20 03:33:55 +00:00
Vítor Vasconcellos
9be7d93e98 [ENG-1220] Fix pdf thumb crashing app (#1460)
Fix pdf thumb crashing app
2023-10-11 00:47:36 +00:00
jake
4395559f44 [ENG-1096] Image Conversions (#1364)
* derive `Type` on `*Extension`

* update `image`, `webp` and add `rspc::Error` support to the `sd-images` crate

* rename function for verbosity

* cleanup clippy allows and use scaling fn for svg conversions

* remove dead comment

* specify `generic` image extensions and add fn to enumerate all compatible extensions

* re-exports and inline hot provided method

* another inline on a provided method

* `formatter` -> `handler` and return an explicit error if the extension isn't supported, and add `convert_image()`

* `get_ext()` inlined helper fn

* add mutation for conversion and query for getting all supported extensions

* fix `svg` scaling and generation

* update bindings

* rm old const

* temporary test for all exts

* verbosity and no manual drop

* remove dbg test

* big enum and remove `cur` extension as `image` doesn't support it

* add huge extension enum

* hopefully get path from file path id and location id

* main merge fix

* chore: update toml and lockfile

* security: update webp

* comment entire crypto crate for build times

* add bincode, huge enum and custom ser/de

* Revert "comment entire crypto crate for build times"

This reverts commit 458addaad60fe845c476402f21404f40330e706b.

* lockfile

* theoretically working ser/de

* add svg scaling

* fix pdf matching bug and use options

* move image scaling fn

* major consts overhaul with good ser/de

* disable heif checking for now due to new trait api

* make the generic handler truly generic

* fix pdf types

* fix pdf scaling so that it's 120dpi A4 paper size by default - height/aspect res are maintained

* heavy cleanup

* note to myself

* bindings & update core to use the scaling fn from the images crate (reducing code dupes)

* move vulnerable `aovec` to be a dev dep so it stays out of release builds (it's only used in tests)

* remoev exif crate from the core as it's handled in a sep. crate

* silence a clippy warning and update lockfile

* lower the maximum file size a slight amount

* bindings and minor dep bumps

* Some improvements

---------

Co-authored-by: Ericson Fogo Soares <ericson.ds999@gmail.com>
2023-10-10 02:57:37 +00:00
Vítor Vasconcellos
1ea3814eec [ENG-939, ENG-1173] PDF Thumbnails (#1242)
* sd-pdf

* Process PDF blocking render inside a spawn_blocking
 - Load a single global Pdfium instance

* Migrate pdf thumb logic to sd-images
 - Replace block_in_place with spawn_blocking
 - Only load LibHeif once
 - Allow thumbnailer (both indexed and non-indexed locations) to process documents
 - Disable loading pdf viewer in Inspection in favour of loading it's thumbnail

* Try to load pdfium lib from absolute path

* Revert removed import due to rebase

* Small nitpick and some warnings

---------

Co-authored-by: Ericson Fogo Soares <ericson.ds999@gmail.com>
2023-10-06 20:41:22 +00:00
Vítor Vasconcellos
f229877c4b [ENG-1054] libheif for Linux (plus fixes) + Webp update (#1405)
* Move postinstall script to a preprep script
 - Fix libheif crate failing to build with our libheif
 - Rework CI due to postinstall to preprep changes

* Linux heif build script + Update webp

* Fix ctrl+c/ctrl+v bug

* Improve libheif linux script
 - Add support for linux aarch64
 - Add CI workflow to build libheif for linux
 - Some other misc fixes

* Fix libheif CI requires sudo

* Fix wrong path for libheif build.rs override in Windows

* Fix wrong path manipulations in libheif build script

* 🤦

* Use ubuntu-latest in libheif action
 - Specify glib version in target triple to support old distros
 - Fix libheif artifact publishing

* Fix artifact upload path again

* Add musl support for libheif
 - Remove unused files from libheif artifact
 - Add setup logic for libheif in postinstall script

* Build libheif for linux as a shared lib

* Fix meson not building the correct arch
 - Add logic to get git branch from githubs CI env vars

* libheif finnaly works on linux
 - Make spacedrive binary rpath point to where appimage and deb expects our libs to be
 - Add some logic to tauri.js to convince tauri to bundle our shared libs
 - Work-around appimage bundling step breaking sometimes
 - Add logic to handle sigint in tauri.js to ensure we clean up after ourselves
 - Rename postinstall.mjs to setup.mjs
 - Add logic to setup.mjs to point our dev build to our shared libs in linux

* Fix windows dekstop dev
 - Rename setup.mjs to preprep.mjs

* test cache-factory

* Fix preprep script not parsing the cross compilation target triple and always using the host info to download dependencies
 - Fix action env vars not being correctly passed
 - Remove possibility to pass multiple targests to rust action

* Don't compile mobile crates on desktop targets

* Remove cache-factory pull_request trigger

* remove patched tauri cli

* Use git plumbing command to get remote branch name
 - Fallback to reading .git/HEAD if remote name was not retrieved

* fix type

---------

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-10-03 17:31:33 +00:00
jake
dacaadc583 Feature/target gate HEIF on Linux (#1312)
* feature/target gate the heif stuff

* more gating

* make clippy happy

* `--cfg linux_heif` override and dep bump

* disable `libheif` on windows temporarily too
2023-09-25 11:18:45 +00:00
Oscar Beaumont
20b129e052 Update Rust dependencies (#1314)
* Update most of Rust dependencies

* downgrade notify

* a

* fix Linux?

* Android is painful

* update build.gradle

* The lord Clippy has spoken

* Bruh

---------

Co-authored-by: jake <77554505+brxken128@users.noreply.github.com>
Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
Co-authored-by: Ericson "Fogo" Soares <ericson.ds999@gmail.com>
2023-09-12 14:03:25 +00:00
jake
1b1ea7a1a4 [ENG-621][ENG-1074] Trait-based image conversion overhaul (#1307)
* sd-images crate which will support raw/dng, bmp, etc

* more work on the image formatter

* re-work `sd-images`, add svg support, r/g/b and r/g/b/a HEIF image support (will all be async again soon)

* remove `ImageFormatter`, add note about r/g/b/(a) heif impl

* implement the image formatter

* rename the conversion trait and minor cleanups

* isolate heif feature and major cleanup

* very untested raw support

* change fn name to `from_path` (a lot more idiomatic)

* clean up orientation fixing

* heif is no longer forbidden (linux has good heif)

also all extensions are correctly matched in lowercase

* fix builds, ext matching, feature gating

* attempt to fix svg handling?

* raw attempt, quite a few errors

* add comment

* new (untested) attempt

* remove `raw` stuff for now

* replace `sd-svg` with a `ToImage` `SvgHandler` impl

* add some simple math to appropriately scale thumbnails (and bmp/ico support)

* add comments regarding how the math works for image thumbs

* rename the trait to `ImageHandler`
2023-09-07 14:08:17 +00:00