Automattic / Automattic/jetpack
Carousel: error thrown in `originalDimensions` function
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
#### Steps to reproduce the issue
1. Activate recommended features in Jetpack.
2. Create new post and add a 1) Tiled Gallery and 2) a Gallery block in Gutenberg.
3. Upload these [two](https://unsplash.com/photos/-SFhuMwFClk) [images](https://unsplash.com/photos/hDqLoCCGOdU). Add a long caption to the last one.
4. Publish post and click one of the images to display the carousel.
#### What I expected
- The clicked image to be displayed correctly in the carousel.
#### What happened instead
- Carousel came up empty (both the image, caption, exif data).
- Site is halted and clicks on the carousel don't work because of a JS error.
- Console shows this JS error:
```
Uncaught TypeError: Cannot read property 'split' of undefined
at a.fn.init.originalDimensions (jetpack-carousel.min.js?ver=20190102:4)
at a.fn.init.e.fn.jp_carousel (jetpack-carousel.min.js?ver=20190102:4)
```

Which seems to originate from the `originalDimensions` function:
https://github.com/Automattic/jetpack/blob/6189a00b72db562d5002b38ae87afce47c717591/modules/carousel/jetpack-carousel.js#L1067
**Screenshots**

Contributor guide
Assessment
This issue has not been assessed yet.