-
Notifications
You must be signed in to change notification settings - Fork 0
merge 1.0.12 #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
merge 1.0.12 #132
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
3954a7a
feat: add px span in pad
volta2030 9554ac5
fix: devide to rect crop
volta2030 1f14322
fix: remove PRIVACYPOLICY (Never need)
volta2030 c5078c4
feat: add PIX moudle
volta2030 7f91db7
feat: add clipboard for color picker #125
volta2030 b757546
feat: npm update
volta2030 bb8389c
fix: change PIX load() name to open() & add convertToPIX()
volta2030 e10ce00
feat: add open & save for pix extension
volta2030 fa3745d
fix: change PIX module function name...
volta2030 896743b
fix: rename moudle import name
volta2030 b12f1b4
feat: add compression & label section in toPix()
volta2030 4c91701
feat: add padColorBox
volta2030 1b0db81
feat: add padColorValue
volta2030 20caa8a
fix: add color to pad command
volta2030 a2acad0
fix: including # to padColor
volta2030 ce7aecd
feat: enable changing padColorBox by padColorValue #126
volta2030 0c400b1
Initial plan
Copilot bacb4d1
Add HEIF/HEIC image format support
Copilot a86b23d
feat: add heif, heic selection into extension-combo selection
volta2030 2feed6f
Merge pull request #127 from Pascal-Institute/copilot/add-heif-opener…
volta2030 11bf7cd
Update README.md
volta2030 d0aeece
feat: add joint section by pix spec in toPix()
volta2030 07ffa05
feat: link colorBox to colorPicker #128
volta2030 72fbfad
Initial plan
Copilot 8835bdf
Add rotating dotted border effect during image drag-and-drop
Copilot 37228be
Fix code review issues: improve animation and dragleave handling
Copilot e35f446
Merge pull request #130 from Pascal-Institute/copilot/add-image-borde…
volta2030 79bab6a
feat: Version Up
volta2030 23af15b
Update imgkit/processing/image_loader.js
volta2030 3041ab7
Update imgkit/processing/image_loader.js
volta2030 b20ae25
Update imgkit/core/image_layer.js
volta2030 f86edda
fix: add return statement when pix save & add missing version up tag
volta2030 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "width": 8, | ||
| "height": 8, | ||
| "channel": 1, | ||
| "depth": 8, | ||
| "compression": { | ||
| "method": "none" | ||
| }, | ||
| "hex_data": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
| "label": { | ||
| "cat": [22, 44], | ||
| "dog": [100, 103] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||||||
| const jsonfile = require("jsonfile"); | ||||||||||
| const sharp = require("sharp"); | ||||||||||
|
|
||||||||||
| class Pix { | ||||||||||
| static open(path) { | ||||||||||
| try { | ||||||||||
| const data = jsonfile.readFileSync(path); | ||||||||||
| return data; | ||||||||||
| } catch (err) { | ||||||||||
| console.error("Error reading pixData.json:", err); | ||||||||||
| return null; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| static save(pixData, path) { | ||||||||||
| try { | ||||||||||
| jsonfile.writeFileSync(path, pixData, { spaces: 2 }); | ||||||||||
| } catch (err) { | ||||||||||
| console.error("Error writing pixData.json:", err); | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| static openFromBuffer(buffer) { | ||||||||||
| try { | ||||||||||
| const text = Buffer.isBuffer(buffer) ? buffer.toString("utf-8") : buffer; | ||||||||||
| return JSON.parse(text); | ||||||||||
| } catch (err) { | ||||||||||
| console.error("Error parsing pix buffer:", err); | ||||||||||
| return null; | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| static async toSharp(pixData) { | ||||||||||
| const payload = pixData?.data ?? pixData; | ||||||||||
| const { width, height, channel, depth, hex_data } = payload; | ||||||||||
| if (!width || !height || !hex_data) return null; | ||||||||||
|
|
||||||||||
| const channels = channel ?? 4; | ||||||||||
| const raw = Buffer.from(hex_data, "hex"); | ||||||||||
| const bytesPerPixel = Math.ceil(depth / 8) * channels; | ||||||||||
| const expectedLength = width * height * bytesPerPixel; | ||||||||||
| if (raw.length < expectedLength) raw.fill(0, raw.length, expectedLength); | ||||||||||
|
|
||||||||||
| return sharp(raw, { | ||||||||||
| raw: { width, height, channels, depth: depth ?? 8 }, | ||||||||||
| }) | ||||||||||
| .png() | ||||||||||
| .toBuffer({ resolveWithObject: true }); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| static async toPix(buffer, info) { | ||||||||||
| const { data, info: rawInfo } = await sharp(buffer) | ||||||||||
|
Comment on lines
+51
to
+52
|
||||||||||
| static async toPix(buffer, info) { | |
| const { data, info: rawInfo } = await sharp(buffer) | |
| static async toPix(buffer) { | |
| const { data, info } = await sharp(buffer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buffer filling logic may not work correctly when
raw.length < expectedLength. Usingfill()on the existing buffer doesn't extend it. Consider usingBuffer.concat([raw, Buffer.alloc(expectedLength - raw.length)])to properly pad the buffer to the expected length.