Comments (5)
any solution for that? It happens on layers with x and y coords which are floats.
in parsePositionAndChannels, the section of:
this.top = this.file.readInt();
this.left = this.file.readInt();
this.bottom = this.file.readInt();
this.right = this.file.readInt();
gives back those wrong values, maybe because it is parsed as int?
from psd.js.
this seems to be still happening ?
children: [ { type: 'layer', visible: true, opacity: 1, blendingMode: 'normal', name: 'Rectangle 1', left: 734, right: 1186, top: 314, bottom: 766, height: 452, width: 452, mask: {}, text: undefined, image: {} } ] },
is the output of the js
https://i.gyazo.com/thumb/1200/ffebaafb0a9ab239dc729e73ffeb154a-png.jpg is the actual size
edit, seems to only happen with grouped layers.
from psd.js.
Any chance your layers are extending beyond the visible canvas? Photoshop will record the coordinates regardless of whether they're actually visible.
Ryan LeFevre (@meltingice)
Sr. Software Engineer
HODINKEE
On Sun, May 1, 2016 at 3:31 PM -0700, "lordminor" [email protected] wrote:
Hi, first of all thanks for made this great tool :)
I recently find out that the sizes and coords of the layers are wrong. The main problem are the coords (left, top, bottom, right) because you get the width and height with that info. In some layers you will have 3px wrong in others 4px and others 1px or no error. Is a kind of weird.
Anyone has a solution for it? I tested with a lot of files, and different versions of photoshop and the issue still happen.
An example: a layer that in photoshop has top: 130, left:50, bottom: 220, right 110 , this plugin return this info when is parsing : top: 128, left: 48, bottom: 221, right: 112.
The main problem is not all the layers has the same difference, so you can't made a function or simply subtract the appropriate number.
Thanks for the help!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
from psd.js.
nop. The layers are centered. I tried with webpage mockups for example. maybe one rectangle has right coords, others don't. I spent a few days trying to fix that but I couldn't :( . If you have some layer outside the canvas, you will see left:-24 for example. But also, that coords are in some cases 1 or 2 px wrong.
from psd.js.
Just bumping this as I am still seeing this issue
from psd.js.
Related Issues (20)
- Feature Request - Support Photoshop Notes
- No `.d.ts` declaration file?
- Error when importing PSD with a text layer from Photopea HOT 2
- How to understand the text style ranges after calling text tool export HOT 1
- How to convert the vector path records into SVG path data HOT 1
- How can i get text Margin HOT 1
- Delete and edit layers
- Can I use psd.js directly in my browser? HOT 2
- Where is the latest source?
- The mask, the mask layer, is there a solution? The mask problem is troublesome
- how can i use it with cdnjs in brower? HOT 1
- Does anyone know the source code address of psd.js 3.9.0? HOT 2
- Getting z-index from PSD.js
- Empty pixelData on some image layers
- PSD does not show any layers HOT 1
- A way to get the version of PSDjs in code
- Error when attempting to import psd.js library
- pen tool path
- Text casing data? does this or any other library retrieve this data?
- how to get the group style
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psd.js.