Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@gcas/imaged
Advanced tools
Readme
A no-dependency toolset for manipulating images in the browser.
Currently only Crop
is implemented.
In-place cropping tool intended for (but not limited to) selecting images for upload. Just invoke the Crop
object on any image you have in the DOM.
See demo in
/test/crop.html
file.
Doesn't alter the original image element at all, it just overlays ontop of it; this means you can place and style your source image however you like before cropping.
Important! The source image must reside in a relatively positioned container and the container must take the exact size of the image.
I found this to be is the easiest way to implement perfect crop layout regardless of scenario. Making the tool auto-responsive without this requirement would complicate things a lot (observers, events, altering the DOM... and still not perfect).
dist/Crop.js
on your page, however you like:
<script src=".../Crop.js">
in the browser;import Crop from "@gcas/imaged/dist/Crop";
if in modules (e.g. typescript);<div style="position: relative; display: inline-flex">
<img id="source" src="..." ... crossorigin />
</div>
position: relative
is important so Crop can take the size of this container (absolute
or fixed
are also fine);display: inline-flex
is only used here to make sure the container takes the exact size of the image;crossorigin
is also important (required for internal canvas);new Crop("#source", { /* options */ })
;I had no time for that; please see the comments in src/Crop.ts
and the exposed (public) methods.
See also the test/crop.html
file for usage examples.
FAQs
Lightweight TypeScript tools for manipulating images in the browser.
The npm package @gcas/imaged receives a total of 0 weekly downloads. As such, @gcas/imaged popularity was classified as not popular.
We found that @gcas/imaged demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.