Giter VIP home page Giter VIP logo

Comments (10)

ericmandel avatar ericmandel commented on July 17, 2024 1

@jllamas This problem is fixed and updated in Github. I tightly limit the pixels for which RGB colors are calculated (for speed) and this limit needed to be extended in cases where non-square images were rotated and displayed in non-square displays, as in your case. I also fixed a typo that caused the panner to go awry in this case.

Because rotation first sets up a transformation maxtrix that gets applied to the display canvas and then redisplays the image, it's tricky to support rotate:90 in the opts object at Load time. In javascript you can just use the onload function:

          JS9.Load(file, {onload: (im) => {
	      JS9.SetRotate(90, {display: im});
	  }});

Let me know if you have problems ...

from js9.

ericmandel avatar ericmandel commented on July 17, 2024 1

@jllamas OK, I believe I have fixed this issue and also fixed some related problems with the panner plugin. It's all updated in GitHub, so "git pull" will get the latest, assuming you cloned.

from js9.

ericmandel avatar ericmandel commented on July 17, 2024

@jllamas Are you using the Montage RotateDats() reprojection call or the cheaper SetRotate() call? And can I get a copy of the FITS file, so that I don't have to dummy up the data? I suspect I didn't work hard enough at changing the dimensions of the image ...

from js9.

jllamas avatar jllamas commented on July 17, 2024

Hey Eric,

You can use the same FITs from my other ticket https://caltech.box.com/s/8t1hbyvsztu1w5l9nvig25kmer74qrjt

We are using JS9.SetRotate() ala:

function rotateFits() {
  if (JS9.GetLoadStatus() == "complete") {
    JS9.SetRotate(-90);
  } else {
    setTimeout(rotateFits, 300);
  }
}

from js9.

ericmandel avatar ericmandel commented on July 17, 2024

@jllamas Ah, thanks, I should have remembered that I have one of your FITS files already. I'll look at this tomorrow.

from js9.

jllamas avatar jllamas commented on July 17, 2024

Hello Eric,

We've deployed the new code (I ended up downloading 3.6 from the website as opposed to github) and it works great!

Loads like this:
Screen Shot 2021-08-02 at 3 40 22 PM

Clicking zoom (-) shows more! Great!
Screen Shot 2021-08-02 at 3 40 26 PM

However clicking the last zoom button, which I would expect to fill the screen to the max boundary. JS9 zoom it even further (-), instead of filling the width.
Screen Shot 2021-08-02 at 3 40 29 PM

Please let us know if that last item is a bug or expected, otherwise we can close this issue.

Thank you very much!
Jacob

from js9.

ericmandel avatar ericmandel commented on July 17, 2024

@jllamas Hi Jacob, it looks right to me, in the sense that going to zoom 1/16 causes the pixels to be resampled by another factor of two, and therefore the image size is reduced by 2 in both width and height. You can see this easily with the Panner plugin ... btw, have you tried zoom to fit? Does that give you the full display you want?

That said, I do wonder what you are expecting ... there may be a nuance I'm missing here.

from js9.

jllamas avatar jllamas commented on July 17, 2024

@ericmandel yeah in the last image above I clicked the 'zoom to fit', and compared to where I was in the middle picture it zoomed out further.

I opened a local fits file, and clicked 'zoom to fit' and it did as expected, filling the view port to the first maximum boundry. The dynamically loaded and rotated image 'zoom to fit', as guess, seems to be using the width before the rotation where its tall and skinny?

from js9.

ericmandel avatar ericmandel commented on July 17, 2024

@jllamas Ah, right, zoomToFit was not taking the rotation into account at all. I have this working on my development machine, but I want to have a look at the panner plugin before I update, there is something not quite right there as well ...

from js9.

jllamas avatar jllamas commented on July 17, 2024

I've updated JS9 in our app, and everything works as expected. Thank you!

from js9.

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.