react-photo-sphere-viewer icon indicating copy to clipboard operation
react-photo-sphere-viewer copied to clipboard

[Bug]: Many images are rendering as cropped panos

Open AndyBaird opened this issue 7 months ago • 14 comments

What happened?

The React wrapper is causing images to warp. Even the demo playground has this behavior when the little planet option is flipped off. I have several test images that are doing it as well with basically nothing in the configuration. PSV had some updates to support cropped panos, and it looks like many 360 images are now rendering as cropped pano images instead of being immersive.

Image

What should have happened?

It should render all 360 images without pinching the top.

Code

Sandbox Link

No response

Library Version

Photo Sphere Viewer version 5.13.2 React Photo Sphere Viewer 6.2.2

What operating system are you using?

macOS

What browser are you using?

None

Logs

No response

Interest to fix the bug

  • [ ] I would like to fix this bug!

AndyBaird avatar May 16 '25 14:05 AndyBaird

It's possible this code change in PSV is relevant: https://github.com/Mu-L/Photo-Sphere-Viewer/commit/31a6f9c5f6c0d5e9abc24c134ad27d8816723e02

AndyBaird avatar May 16 '25 14:05 AndyBaird

holy shit! It's a really new thing, that's happening now... wtf, this is really strange.

Elius94 avatar May 16 '25 15:05 Elius94

Ok @AndyBaird it's a problem with CodeSandbox. If you try the full window preview it's ok!

Image

Image

I think that it's something related to the iframe or something similar in the Cs

Elius94 avatar May 16 '25 15:05 Elius94

If you run a project in local everythink works

Elius94 avatar May 16 '25 15:05 Elius94

The app I am working on is experiencing it too. Its really strange though because it seems like its only localhost. On the left is localhost and the right is production. Its the same uploaded image and the same code.

Image

AndyBaird avatar May 16 '25 15:05 AndyBaird

ok so you are telling me that in localhost it makes the issue and in production no, is it true? If you can help me to figure it out I will appreciate really

Elius94 avatar May 16 '25 15:05 Elius94

Yes, thats the case for me. Localhost shows warped images but those same images in production look fine.

AndyBaird avatar May 16 '25 15:05 AndyBaird

I've tried removing the panoData from the image, also adding a bunch of panoData, and I've tried adding/removing plugins but none of that made any difference

AndyBaird avatar May 16 '25 15:05 AndyBaird

https://codesandbox.io/p/sandbox/react-photo-sphere-viewer-virtualtour-mj2p5k try that, also in local! For me it works...

Elius94 avatar May 16 '25 16:05 Elius94

The sandbox works. I'm starting to suspect there's something in the image data that is causing it. I can only reproduce the issue with certain images while others from the same camera render normally.

AndyBaird avatar May 16 '25 16:05 AndyBaird

that's really strange and brand new. this does not happens in the past days...

Elius94 avatar May 16 '25 16:05 Elius94

The main sandbox in my repo shows the issue but if you go in full screen preview not.

Elius94 avatar May 16 '25 16:05 Elius94

I found a way to reproduce it. I am using a cloud provider to load the images, and they provide options for resizing etc. When I remove their option for c_limit,w_3000 I can reproduce the issue. The description of that option is:

Same as the fit mode but only if the original asset is larger than the specified limit (width and height), in which case the asset is scaled down so that it takes up as much space as possible within a bounding box defined by the specified width and height parameters. The original aspect ratio is retained (by default) and all of the original asset is visible.

That option is basically shrinking the image and making sure the aspect ratio is retained. Once I take that away and just load the raw image it warps.

AndyBaird avatar May 16 '25 16:05 AndyBaird

I know that doesn't directly address it, but it does tell us that image resizing & aspect ratio is having an impact. Which might also explain why the full screen preview does not have the issue.

AndyBaird avatar May 16 '25 16:05 AndyBaird