Skip to content

Bug: GetSourceScreenshot not giving correct MIME type for imageFormat: jpg #1298

@cmack

Description

@cmack

Operating System Info

Other

Other OS

Guix Linux

OBS Studio Version

Other

OBS Studio Version (Other)

30.1.2

obs-websocket Version

5.4.2 (as reported by API "GetVersion")

OBS Studio Log URL

https://obsproject.com/logs/vsY4qNMNL2cNp8pn

OBS Studio Crash Log URL

No response

Expected Behavior

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

  1. When making a GetSourceScreenshot request with imageFormat: "jpg" the response's imageData field uses the "image/jpg" mimetype, which is incorrect.
  2. 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

  1. Make a an appropriate "GetSourceScreenshot" request with the imageFormat: "jpg"` key set
  2. Witness the response's imageData value beginning with "data:image/jpg;...."
  3. Feel the problem when trying to make an SVG element like:
 <image xlink:href="{verbatim-imageData-from-OBS-here}" :x 0 :y 0 :width 300 :height 300></image>

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions