ricohapi / theta-client

A library to control RICOH THETA
MIT License
15 stars 11 forks source link

fileListing fails if images are in 5504x5504 format #71

Closed codetricity closed 3 months ago

codetricity commented 6 months ago

On the THETA X, if there are images in 5504x5504 format, the fileListing fails. The debug log shows the proper filelisting content. camera.listFiles works.

Although the 5504x5504 format may not be officially supported, the output of camera.listFiles does work and thus, I can rewrite my app to get the fileListing from camera.listFiles instead use using theta-client. However, I would like to use theta-client.

error

HttpClient: RESPONSE http://192.168.1.1/osc/commands/execute failed with exception: io.ktor.serialization.JsonConvertException: Illegal input

full log

I/System.out(28352): {"name":"camera.listFiles","parameters":{"fileType":"all","startPosition":0,"entryCount":10000,"maxThumbSize":0,"_detail":true}}
I/System.out(28352): BODY END
I/System.out(28352): HttpClient: RESPONSE: 200 OK
I/System.out(28352): METHOD: HttpMethod(value=POST)
I/System.out(28352): FROM: http://192.168.1.1/osc/commands/execute
I/System.out(28352): COMMON HEADERS
I/System.out(28352): -> Connection: Keep-Alive
I/System.out(28352): -> Content-Length: 1525
I/System.out(28352): -> Content-Type: application/json; charset=utf-8
I/System.out(28352): -> User-Agent: Dalvik/2.1.0 (Linux; U; Android 10; RICOH THETA X Build/QKQ1.210402.001)
I/System.out(28352): -> X-Content-Type-Options: nosniff
I/System.out(28352): BODY Content-Type: application/json; charset=utf-8
I/System.out(28352): BODY START
I/System.out(28352): {"results":{"entries":[{"dateTimeZone":"2024:02:19 14:10:37-08:00","_favorite":false,"fileUrl":"http://192.168.1.1/files/100RICOH/R0010007.JPG","height":5504,"_imageDescription":"","isProcessed":true,"name":"R0010007.JPG","previewUrl":"","_projectionType":"","size":5271438,"_storageID":"412176649172527ab3d5edabb50a7d69","_thumbSize":6181,"_uploaded":false,"width":5504},{"dateTimeZone":"2024:02:18 08:09:56-08:00","_favorite":false,"fileUrl":"http://192.168.1.1/files/100RICOH/R0010003.JPG","height":2752,"_imageDescription":"","isProcessed":true,"name":"R0010003.JPG","previewUrl":"","_projectionType":"Equirectangular","size":4214567,"_storageID":"412176649172527ab3d5edabb50a7d69","_thumbSize":10729,"_uploaded":false,"width":5504},{"dateTimeZone":"2024:02:17 14:21:23-08:00","_favorite":false,"fileUrl":"http://192.168.1.1/files/100RICOH/R0010002.JPG","height":2752,"_imageDescription":"","isProcessed":true,"name":"R0010002.JPG","previewUrl":"","_projectionType":"Equirectangular","size":4238256,"_storageID":"412176649172527ab3d5edabb50a7d69","_thumbSize":7534,"_uploaded":false,"width":5504},{"dateTimeZone":"2024:02:17 14:21:15-08:00","_favorite":false,"fileUrl":"http://192.168.1.1/files/100RICOH/R0010001.JPG","height":2752,"_imageDescription":"","isProcessed":true,"name":"R0010001.JPG","previewUrl":"","_projectionType":"Equirectangular","size":4218202,"_storageID":"412176649172527ab3d5edabb50a7d69","_thumbSize":7578,"_uploaded":false,"width":5504}],"totalEntries":4},"name":"camera.listFiles","state":"done"}
I/System.out(28352): BODY END
I/System.out(28352): HttpClient: RESPONSE http://192.168.1.1/osc/commands/execute failed with exception: io.ktor.serialization.JsonConvertException: Illegal input

image

image

with the 5504x5504 file removed

image

other

The official mobile app doesn't list the files in 5504x5504 format, but the other files are listed. This is better behavior than just showing an error. Also, information is in camera.listFiles . Is there any problem showing it?

"fileUrl":"http://192.168.1.1/files/100RICOH/R0010007.JPG","height":5504,"_imageDescription":"","isProcessed":true,"name":"R0010007.JPG","previewUrl":"","_projectionType":"","size":5271438,"_storageID":"412176649172527ab3d5edabb50a7d69","_thumbSize":6181,"_uploaded":false,"width":5504
simago commented 6 months ago

@codetricity The response for 5504*5504 includes "_projectionType":"" which causes JsonConvertException. Current implementation of Theta Client requires that "_projectionType" must have a value one of "Equirectangular", "Dual-Fisheye" or "Fisheye".

codetricity commented 6 months ago

@simago thank you for the explanation. This is not important as there is a workaround.

Recently, someone asked about the single fisheye in our forum. In response to his question, I decided to use theta-client to provide an example open source app for Android. The person was able to use the app. However, I was thinking of improving it to fix the fileListing.

BTW, the original purpose of the sample app was to test the image bitrate of the 11K images of the THETA X for automotive interior shots. I was going to open the issue below, but didn't want to be too bothersome.

https://github.com/ricohapi/theta-client/issues/70

The BitrateNumber appears to only work for video files. Is that correct? I would like to set the BitRate number for image files. https://github.com/ricohapi/theta-client/blob/bc2ba2109056aeaececfc19a2f09634a6c9c8d4f/flutter/lib/theta_client_flutter.dart#L1868

Addtionally, I can't get the options.ImageStitching to work with theta-client. I have to use a http POST request.

// theta-client options not working
// final options = Options();
// options.imageStitching = ImageStitchingEnum.auto;
ywatanabe-dev commented 6 months ago

@codetricity Sorry for the delay in replying.

With the current SDK, the bitrate setting is not reflected in still image capture. As a means of setting it, _bitrate will be configurable in PhotoCaptureBuilder in the future release. Also, the serialization error with _projectionType will be fixed.

Failure to get options.ImageStitching was not reproduced in my environment. Please send us more detailed information.

simago commented 3 months ago

@codetricity We appended a description how to set bitrate number to still image files. https://github.com/ricohapi/theta-client/blob/main/docs/tutorial-flutter.md#set-the-bitrate-value-for-still-image-capture-theta-x

codetricity commented 3 months ago

Thank you for all your work. i'm using theta-client in a demo for the ricoh360 platform API.