Skip to content

Conversation

@GitMurf
Copy link
Owner

@GitMurf GitMurf commented Dec 11, 2022

No description provided.

LinusU and others added 30 commits January 14, 2019 12:35
I forgot to commit this file with #1345 :(.
Pass metadata to PDF stream function
Explicitly list files to be included in package
…()` (#1382)

* Add missing opts parameter

* Add changelog entry
* Fixed build for electron 5

* Updated changelog
Guard JPEG width/height against maximum supported
…Image (#1255)

* save work

* middle-way

* fixed

* swap a line

* saved tests

* ,aybe mergeable

* ,aybe mergeable

* removed commented code, added a comment

* fixed comment

* removed float for doubles

* removed extra comment

* removed extra boolean

* added tests

* no semicolons
Use simple-get for fetching images
Appears to save ~1.5-2 MB of memory and improves startup speed.
* adds crossOrigin attribute to loadImage

without that using the image later with webgl errors
 DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The image element contains cross-origin data, and may not be loaded.

* Standard Style

* support any properties on an HTMLImageElement

#1402 (comment)

* loadImage accepts any options now
Philippe Plantier and others added 8 commits January 11, 2025 16:32
agilgur5 and others added 21 commits March 29, 2025 16:26
This installation error on Node 22.14+:
```
npm error prebuild-install warn This package does not support N-API version undefined
npm error prebuild-install warn install No prebuilt binaries found (target=undefined runtime=napi arch=x64 libc= platform=linux)
```

is resolved by updating to newer `prebuild-install` 7.1.3, which has a newer version of `napi-build-utils` (2.0.0) with a bugfix for newer N-API version comparison
Claude found it right away

Fixes #2490
* fix(TextMetrics): rtl direction + start/end textAlign
* changelog
* update tests
* expose resolveTextAlignment
* jest test
A little kludgey to force 2 calls in canvas.cc but 2 calls are
necessary when changing size anyways, so it's the more general
usage. TODO remove backends anyways

Fixes #2514
0. Most importantly this fixes the dumb mistake I made in the
   previous commit: not all backends implemented destroySurface.
1. Both Backend and Pdf/SvgBackend were cleaning up memory on exit.
   This responsibility should not be unclear; let's just do it all
   in the child class, since PdfBackend and SvgBackend have other
   stuff to cleanup. This is all still less code.
2. The only reason to destroy the surface is if it's dirty from
   e.g. setWidth (this is referring to isSurfaceValid)
3. Make createSurface idempotent. This allows us to merge it with
   getSurface() and makes it safer. Call it ensureSurface.
Regressed in 3dca82a

This was originally added in
cfc6dfd, but I don't think that
assessment is right at least for the current bug: cairo_destroy,
called after the backend's SetWidth, still holds a reference
to the surface and calls the closure (presumably for leading
<svg> or something?).

I can't get it to happen consistently enough to write a test,
sadly.

Fixes #2520
compiles to the same thing before/after at any optimization level
Co-authored-by: Caleb Hearon <caleb@chearon.net>
Description:
- To handle non-string/non-Buffer sources while fetching image.
- Add test cases for '', null, and undefined inputs to loadImage()

Test Result:
```
npm run test
...
      ✔ rejects when loadImage is called with null
      ✔ rejects when loadImage is called with undefined
      ✔ rejects when loadImage is called with empty string

  291 passing (302ms)
  6 pending
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.