[Bug]: Many images are rendering as cropped panos
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.
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!
It's possible this code change in PSV is relevant: https://github.com/Mu-L/Photo-Sphere-Viewer/commit/31a6f9c5f6c0d5e9abc24c134ad27d8816723e02
holy shit! It's a really new thing, that's happening now... wtf, this is really strange.
Ok @AndyBaird it's a problem with CodeSandbox. If you try the full window preview it's ok!
I think that it's something related to the iframe or something similar in the Cs
If you run a project in local everythink works
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.
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
Yes, thats the case for me. Localhost shows warped images but those same images in production look fine.
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
https://codesandbox.io/p/sandbox/react-photo-sphere-viewer-virtualtour-mj2p5k try that, also in local! For me it works...
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.
that's really strange and brand new. this does not happens in the past days...
The main sandbox in my repo shows the issue but if you go in full screen preview not.
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.
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.