Search…

X3 Photo Gallery Support Forums

Search…
 
Aussie
Topic Author
Posts: 1
Joined: 09 May 2019, 10:54

SyntaxError: Unexpected end of JSON input

10 May 2019, 18:53

Any idea how I can get around this error?  "SyntaxError: Unexpected end of JSON input" 
I am trying to upload the file to an on premise installation a 360 degree panorama photo taken with an Insta360 camera.  The file is 12.5MB file 7680x3840 96dpi.  Thank you in advance for any help to get pass this error.  I have a few thousand files to upload waiting on resolution to this error.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: SyntaxError: Unexpected end of JSON input

11 May 2019, 09:04

The "SyntaxError: Unexpected end of JSON input" provided by X3 is not very helpful, and essentially just means that the upload fails on server side ... Almost certainly related to the file size > 10 MB. Can you please check your X3 website server diagnostics, and tell me what values you see for the following items: Upload Max File Size and Post Max Size?
Code
yourwebsite.com/?diagnostics
I am guessing the limit is < 12.5 MB (the size of your file), in which case, you may need to upload by FTP. The upload limits are assigned by your server, and can't be bypassed by X3, unless you are allowed to edit them from your hosting.

On a related note ... Perhaps you should try to optimize your panorama image slightly prior to upload? I'm pretty sure it's more than feasible to squeeze your image size well under 10MB, which might solve the upload issue also ... 12MB may require excessive loading by your visitors. The images in our X3 panorama demo are between 1-4 MB, also for 8192 px wide images:
https://demo.photo.gallery/examples/plugins/panorama/

You might even be able to compress lossless with an app like ImageOptim.

Another related issue, is that many browsers (especially mobile browsers) will only support up to 4096 px wide images as panorama textures, and that is why we by default recommend max 4096 px as pointed out in the panorama documentation. You can upload larger resolution (for example  7680 px), which will work on most modern desktops, and X3 will attempt to resize the image DOWN to 4096 px for display on mobile devices. HOWEVER, your server/hosting may not be capable of resizing such large images (7680 px), in which case you would need to manually create a 4096 px version of your images.
X3 Docs wrote:Equirectangular upload dimensions
The reason we recommend 4096 px width is because 4096 is the max_texture_size supported by all devices, and offers a balance between file size and visual quality. Most modern desktops also support 8192 px textures, so you can upload your sources at 8192 px if you want higher quality. If you upload sources at 8192 px, you will need to make sure your server is powerful enough to downsize 8192 px images, or you will have to create downsized versions manually.