You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: GetSourceScreenshot not giving correct MIME type for imageFormat: jpg #1298
Whether imageFormat: 'jpg' or imageFormat: 'jpeg' is submitted, the resulting encoded data uri gives the correct 'image/jpeg' MIME type.
If there are other supported image types listed in the "GetVersion" request having MIME types different than simply prepending image/ to it, it would be nice for them to have their correct MIME type, too.
Current Behavior
When making a GetSourceScreenshot request with imageFormat: "jpg" the response's imageData field uses the "image/jpg" mimetype, which is incorrect.
Making the same request with imageFormat: "jpeg" the response's imageData field has the correct "image/jpeg" mimetype
Steps to Reproduce
I enabled the debug setting in the submitted log file for the request / response payloads to be evident
Make a an appropriate "GetSourceScreenshot" request with the imageFormat: "jpg"` key set
Witness the response's imageData value beginning with "data:image/jpg;...."
Feel the problem when trying to make an SVG element like:
and seeing no resulting rendering from librsvg
4. Try step 1 - 3 again with imageFormat: "jpeg" at 1; see "data:image/jpeg..." at step 2; and a rendered image at step 3.
Anything else we should know?
I wish I could have tested with a more recent OBS but looking at the main branch, it looks like the "image/" prepend logic is still there and would affect the current version, too.
The encoded data URL starts with "data:image/jpg", the correct requested MIME type.
It can also be seen that within the requesthandler/RequestHandler_Sources.cpp it stores the requested Image Format, check if it is a supported format, and if so, pastes the requested image format as it is into the start of the encoded base64 data string.
184std::stringimageFormat=request.RequestData["imageFormat"];
185186if (!IsImageFormatValid(imageFormat))
187returnRequestResult::Error(RequestStatus::InvalidRequestField,
188"Your specified image format is invalid or not supported by this system.");
230QStringencodedPicture=QString("data:image/%1;base64,").arg(imageFormat.c_str()).append(encodedImgBytes.toBase64());
Thus, the above bug has already been fixed. Proposing this issue be closed.
The encoded data URL starts with "data:image/jpg", the correct requested MIME type.
I disagree with "correct". I apologize if I wasn't clear in my original filing but image/jpg is not an official MIME type. I am requesting that image/jpeg should be returned whether the request uses "jpg" or "jpeg" for the imageFormat field.
Activity
andrewsoncha commentedon Mar 24, 2026
I tested the Requests mentioned above and they seem to have been fixed.
GetSourceScreenshot Request body ("jpeg" MIME type)
{ "op": 6, "d": { "requestType": "GetSourceScreenshot", "requestId": "arbitraryRequestID", "requestData": { "sourceName": "Face", "imageFormat": "jpeg" } } }GetSourceScreenshot Response body ("jpeg" MIME type)
{ "d": { "requestId": "arbitraryRequestID", "requestStatus": { "code": 100, "result": true }, "requestType": "GetSourceScreenshot", "responseData": { "imageData": "data:image/jpeg;base64,/9j/someBase64Image" } }, "op": 7 }The encoded data url starts with "data:image/jpeg", the correct requested MIME type.
GetSourceScreenshot Request body ("jpg" MIME type)
{ "op": 6, "d": { "requestType": "GetSourceScreenshot", "requestId": "arbitraryRequestID", "requestData": { "sourceName": "Face", "imageFormat": "jpg" } } }GetSourceScreenshot Response body ("jpg" MIME type)
{ "d": { "requestId": "arbitraryRequestID", "requestStatus": { "code": 100, "result": true }, "requestType": "GetSourceScreenshot", "responseData": { "imageData": "data:image/jpg;base64,/someBase64Image” } }, "op": 7 }The encoded data URL starts with "data:image/jpg", the correct requested MIME type.
It can also be seen that within the requesthandler/RequestHandler_Sources.cpp it stores the requested Image Format, check if it is a supported format, and if so, pastes the requested image format as it is into the start of the encoded base64 data string.
Thus, the above bug has already been fixed. Proposing this issue be closed.
cmack commentedon Mar 24, 2026
I disagree with "correct". I apologize if I wasn't clear in my original filing but
image/jpgis not an official MIME type. I am requesting thatimage/jpegshould be returned whether the request uses "jpg" or "jpeg" for theimageFormatfield.andrewsoncha commentedon Mar 24, 2026
Oh! I apologize. I misunderstood the bug.