Code Monkey home page Code Monkey logo

Comments (5)

tomermes avatar tomermes commented on June 18, 2024 1

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.

Leigham avatar Leigham commented on June 18, 2024 1

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.

meltingice avatar meltingice commented on June 18, 2024

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.

lordminor avatar lordminor commented on June 18, 2024

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.

andomain avatar andomain commented on June 18, 2024

Just bumping this as I am still seeing this issue

from psd.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.