Commit graph

69 commits

Author SHA1 Message Date
Sami Ansari
583331e065
feat: add isImageFile() static utility method (#41)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
* feat: add isImageFile() static utility method

Adds a static isImageFile() method to CImage that validates if a file
path points to a loadable image by attempting to load it. Returns true
only if the image loads successfully. Memory is freed immediately after
the check via scope block.

* image: optimize isImageFile to check header only

Use formatFromFile() which reads only the file header via libmagic
instead of loading and decoding the entire image.
2026-01-12 18:27:47 +01:00
Hiroki Tagato
f114ea3d97
core: add missing #include <span> (#40)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
Without it, build fails with the following error: error: no template
named 'span' in namespace 'std'
2026-01-05 12:02:58 +01:00
4af02a3925
version: bump to 0.5.0
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-12-28 19:25:35 +01:00
790adab7eb
image: fix missing svg byte stream 2025-12-28 19:09:51 +01:00
6cfc891808
resource/image: add byte stream 2025-12-28 18:53:12 +01:00
28e17fbf49
image/svg: implement embedded
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
2025-12-28 15:30:01 +01:00
8a860f2949
image: cleanup format detection 2025-12-28 15:29:58 +01:00
8f1bec691b
version: bump to 0.4.0
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-11-21 14:04:00 +00:00
1fb5bfbd62
resource/AsyncResource: add await() for resources
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-11-18 17:43:36 +00:00
ffc999d980
version: bump to 0.3.0
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-11-06 20:47:32 +00:00
e381b2f1f0
resources/text: fix alignment layout for center/right 2025-11-06 20:42:13 +00:00
Felix Salcher
50fb9f0692
resource/image: add buffer option to image resource (#39)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
* add buffer option to image resource

There were also some changes made to the types of the span. The content
is now always a const uint8_t, as if shouldn't be mutable. We can also
omit the reference to the span, as it is very lightweight and can
therefore be copied

* move buffer to StaticImageResource

* minor fixes

* minor fixes

again
2025-10-14 14:37:28 +02:00
9431db625c
version: bump to 0.2.0
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-10-03 12:18:12 +01:00
2503063d75
ci: add librsvg to arch 2025-10-03 12:15:30 +01:00
899ff15787
Nix: add librsvg dep
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-10-01 22:16:34 +03:00
f4995eaa46
image: add svg support
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
2025-09-30 20:33:36 +01:00
32e6b8386f
text: recalc layout after setting limits
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-09-22 21:16:20 +01:00
72e6801f08
text: make wrap and ellipsize passed 2025-09-22 21:14:40 +01:00
d839c3f808
text: wrap when limited 2025-09-22 21:12:09 +01:00
ecdbae40ae
text: minor fixups 2025-09-22 21:10:43 +01:00
758678a614
text: add aa and hint to text
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
2025-09-22 20:08:59 +01:00
c44e749dd6
version: bump to 0.1.6
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-09-18 11:47:13 +01:00
Vaxry
b86c4d9ed3
asyncResourceGatherer: add new module (#36)
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
Adds a new module based on the hyprlock gatherer

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2025-09-17 14:42:36 +02:00
Maximilian Seidler
aa9d14963b
png: fix gray pix formats (#35)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-09-11 00:21:04 +02:00
Linux User
621e2e00f1
formats: include vector header (#34)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
Fixes error `no member named 'vector' in namespace 'std'` on llvm/musl
2025-09-03 11:21:59 +02:00
Ramy Kaddouri
157cc52065
formats: add optional AVIF image support with libheif (#32)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
Adds support for AVIF image loading

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2025-08-20 09:30:02 +01:00
x70b1
4c1d63a0f2
chore: replace libspng with libpng in README.md and CI/Arch (#30)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
* replace libspng with libpng in README.md

* replace libspng with libpng in CI/Arch

---------

Co-authored-by: x70b1 <x70b1@users.noreply.github.com>
2025-08-04 12:56:53 +02:00
340494a38b
version: bump to 0.1.5
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-07-10 14:05:40 +02:00
Maximilian Seidler
83885a6edf
formats: fix format selection and some safeguards (#28)
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
* formats: differentiate between JPEG and JXL when using magic

* formats: check magic bytes for jpeg and webp

* jpeg: error handling bs for libjpeg
2025-07-10 10:17:08 +02:00
b841473a0b
png: libpng is straight alpha, but cairo is premult
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
ref #23
2025-07-06 15:22:25 +02:00
Felix Salcher
a71c0529d1
internal: fix style as determined by clang (#27) 2025-07-06 15:14:40 +02:00
Linux User
5f9c68e3f8
image: include span header (#26)
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
Fixes error `no template named 'span' in namespace 'std'` on llvm/musl
2025-07-05 22:05:59 +02:00
Felix Salcher
13375fa03f
core: Add Image Embedding Support (#24)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
Images can now be loaded from an std::span<> of bytes. For now, png only.
2025-07-03 21:07:39 +02:00
b3d628d016
version: bump to 0.1.4
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-06-22 21:42:57 +02:00
15c6f8f3a5
CI/Nix: add cache-nix-action
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
Use nixbuild/nix-quick-install-action which pairs well with
nix-community/cache-nix-action.

Should help with build times by reducing the number of packages needing
to be re-downloaded on each run.

Parameters are taken from https://github.com/nix-community/cache-nix-action
and may be tweaked later.
2025-06-20 01:21:57 +03:00
c7225d7375 images/png: mark surface dirty after copy
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
fixes #22
2025-06-06 21:34:12 +02:00
Friday
80b754e38e
nix: update to gcc15 (#21)
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
also updated dependencies in flake.lock
2025-06-05 18:46:40 +01:00
Vaxry
df811098c1
formats: move to libpng for png support (#19)
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
closes #18
2025-06-05 14:10:27 +01:00
Honkazel
6075491094
core: clang-tidy & comp changes (#15)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
* some clang-tidyfy

* designated init in Color header

* some linkage changes

* just doin some casts explicit

* oeao

* bruh

* explicitly cast to size_t, not ptrdiff_t
2025-04-19 00:31:30 +02:00
9d7f2687c8 version: bump to 0.1.3
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-04-06 16:28:42 +01:00
UjinT34
760d67a2a8
color: CM structs, constants & math (#14) 2025-04-06 17:27:46 +02:00
175c6b29b6
CI: remove deprecated magic-nix-cache-action
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-02-08 23:11:11 +02:00
Jan Beich
575ae47b78
cmakelists: pass all libjxl CFLAGS/LDFLAGS after 52202272d8 (#13)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
JXL_LIBRARIES contains `pkg-config --libs-only-l libjxl` but FreeBSD
also needs JXL_LIBRARY_DIRS aka `pkg-config --libs-only-L libjxl`.
2025-02-06 11:23:12 +00:00
e19ee9031a version: bump to 0.1.2
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-02-04 16:55:19 +00:00
davc0n
5ac80e3686
tests: add a symlink test (#10)
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
* Add symlink test

* Add tests output dir to .gitignore
2025-02-01 20:10:59 +01:00
12cd7034e4 png: handle invalid buffer size returned by libspng
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
sometimes (no clue why) spng_decoded_image_size is just plain wrong. In those cases, just guess what the size should be with 32bpp.

fixes #9
2025-01-27 23:00:29 +00:00
23783b9603
CI/Arch/Clang: add libspng
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
2025-01-27 15:43:56 +02:00
6355b72d9c
Nix: add libspng dep 2025-01-27 15:42:22 +02:00
0c11438de4 core: move to libspng for png
Some checks are pending
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Waiting to run
Build & Test (Arch) / Arch: Build and Test (clang) (push) Waiting to run
Build & Test / nix (hyprgraphics) (push) Waiting to run
Build & Test / nix (hyprgraphics-with-tests) (push) Waiting to run
2025-01-27 13:39:39 +00:00
0d77b4895a
flake.lock: update
Some checks failed
Build & Test (Arch) / Arch: Build and Test (gcc) (push) Has been cancelled
Build & Test (Arch) / Arch: Build and Test (clang) (push) Has been cancelled
Build & Test / nix (hyprgraphics) (push) Has been cancelled
Build & Test / nix (hyprgraphics-with-tests) (push) Has been cancelled
2025-01-23 14:21:29 +02:00