Repository navigation
obs-websocket: Label screenshots with the real MIME type - #652
Merged
zackees merged 2 commits intoOct 13, 2026
Merged
Conversation
GetSourceScreenshot labelled its data URL "image/" plus the requested format name, but the names are Qt image writer names (file extensions), so "jpg" came back as "data:image/jpg", which is not a MIME type, and "ppm" as "data:image/ppm". obs-rust/obs-websocket#6 maps the writer's format names to their registered types with a fixed table (no dependency on the system's MIME data). Move the submodule from a4040cb (obs-rust/obs-websocket#9) to 3e46553, the merge of obs-rust#6 on top of it, and add test_ws_image_mime, which builds the helper from the plugin source on its own: 4 of 5 cases fail against the fork's helper-only commit and all 5 pass here. Reported upstream in obsproject/obs-websocket#1298 by cmack. Fixes obs-rust#523. Co-Authored-By: Claude Opus 5.5 <[email protected]> Local-Gate: v1 tree=0bda6cde7d6d43558b289e6a4c5657ba5b79a390 secs=511 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791932642,"gate":"rust/all/fmt","host":"linux-x86_64","key":"56712ff4f494234c658dde9bf072511f27f83b32e5258647edaa0960ff822b1e","lane":"lint","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":36,"stamp":"7a0219afa75b08288667d44530d9d3dc","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"56712ff4f494234c658dde9bf072511f27f83b32e5258647edaa0960ff822b1e","lane":"lint","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":36,"stamp":"a28fdc6843d0a6a1efb8f56c1c23226c","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"0a26a3da188ac6df7cacddf394b31ac8aee4f17722f8fcfb7e16f16c6545607d","lane":"rust-test","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":188,"stamp":"648509e8d3aa287a22e48e49b3d4b8c4","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"31e220a9f75224a0652e009c7cefda6842c7b689923577113c66ea6c038bbc7f","lane":"cross","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"7a9f0013c352502c3d51ad804772dad6","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"31e220a9f75224a0652e009c7cefda6842c7b689923577113c66ea6c038bbc7f","lane":"cross","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"e20920cba594d6cff6c18eaa58f06dda","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"31e220a9f75224a0652e009c7cefda6842c7b689923577113c66ea6c038bbc7f","lane":"cross","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"97a31be153dbb8d7326d6ca770662db7","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"31e220a9f75224a0652e009c7cefda6842c7b689923577113c66ea6c038bbc7f","lane":"cross","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"fcccde5645d69a4439666be55bb76a20","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"31e220a9f75224a0652e009c7cefda6842c7b689923577113c66ea6c038bbc7f","lane":"cross","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"a281400a7593e0cc03ff5597876b023f","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"31e220a9f75224a0652e009c7cefda6842c7b689923577113c66ea6c038bbc7f","lane":"cross","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"6bbeb0ed509658dbfbb9c9f55bad2381","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"} Ci-Attestation: {"at":1791932642,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"1b19e58298733d30e063360d21c4f9aada312536ef6a1ce1e471a24ff8dd5d5c","lane":"tier2-linux","parents":["b2557dea89bc3f730d829ca66241fa9e1d46a9aa"],"secs":143,"stamp":"d422d5aa241f41f79924b3f80fbea575","tree":"0bda6cde7d6d43558b289e6a4c5657ba5b79a390","v":1,"via":"run"}
Member
|
Verified red → green by compiling
Submodule check:
|
zackees
force-pushed
the
fix/ws-screenshot-jpeg-mime-bump
branch
from
October 13, 2026 23:04
bba1191 to
61338b1
Compare
Member
This was referenced Oct 14, 2026
zackees
added a commit
to ProtonDev-sys/obs-studio
that referenced
this pull request
Oct 15, 2026
obs-rust#652's submodule bump does not compile: RequestHandler_Sources.cpp uses Utils::ImageFormat::MimeType without including utils/ImageFormat.h, so every full build fails. Fork PR obs-rust/obs-websocket#10 adds it. The fork's master also carries the already-merged fork PRs obs-rust#4 (obs-rust#514), Local-Gate: v1 tree=2c043672b59777c9875e71d75f8962a2fdcb2e27 secs=390 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791938027,"gate":"rust/all/fmt","host":"linux-x86_64","key":"0081647f2e1e319399eadebe73c4c68f82d82cf39f79ff14c6ce573cf603b987","lane":"lint","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":44,"stamp":"d8f293eff24644b378fcc7f31784e730","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"0081647f2e1e319399eadebe73c4c68f82d82cf39f79ff14c6ce573cf603b987","lane":"lint","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":44,"stamp":"f941a2368ea561c6cc1dd404c2254082","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"b13eada16907902b0fe80a2fe16e3a0b69505f862a9c2cf24825f5001a0fb44e","lane":"rust-test","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":110,"stamp":"90332b84a5900768164f7d01a143f8d9","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"e53f213473aa96a3b2882f11a7db911cb5cf490f619ab3ed4a39d7155ed11370","lane":"cross","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":73,"stamp":"e3d99bf3954d09c8d88d4448fb238619","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"e53f213473aa96a3b2882f11a7db911cb5cf490f619ab3ed4a39d7155ed11370","lane":"cross","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":73,"stamp":"ba366c0508bf9aaa859018ca425f4155","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"e53f213473aa96a3b2882f11a7db911cb5cf490f619ab3ed4a39d7155ed11370","lane":"cross","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":73,"stamp":"b24b299806567a535ad007d4d651ba6e","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"e53f213473aa96a3b2882f11a7db911cb5cf490f619ab3ed4a39d7155ed11370","lane":"cross","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":73,"stamp":"bcdc3176b3f88ddf85a00b2b33e3f740","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"e53f213473aa96a3b2882f11a7db911cb5cf490f619ab3ed4a39d7155ed11370","lane":"cross","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":73,"stamp":"0a29c50a3e9953e8b80c58d25a705081","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"e53f213473aa96a3b2882f11a7db911cb5cf490f619ab3ed4a39d7155ed11370","lane":"cross","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":73,"stamp":"7df3b007f64dbc45d235c8b685613569","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} Ci-Attestation: {"at":1791938027,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"e892aee0e6c73f12c54e4b950ce1a04d39e07265b66aec3f515500b36ff4f4e2","lane":"tier2-linux","parents":["08483ba1e85e1fd3b79c46a9f9924a968b31a47c"],"secs":163,"stamp":"ea01d6463104759ff9cf3a70a9074f33","tree":"2c043672b59777c9875e71d75f8962a2fdcb2e27","v":1,"via":"run"} obs-rust#5 (obs-rust#519) and obs-rust#7 (obs-rust#536).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
obs-websocket's
GetSourceScreenshotnow labels its data URL with the real MIME type. Asking forjpgused to returndata:image/jpg;base64,..., which is not a MIME type; it now returnsimage/jpeg, likejpegalready did. The other format names that are not their own MIME subtype (jfif,ppm,pgm,pbm,ico,cur,xbm,xpm) are fixed the same way.png,bmpandjpegare unchanged."image/"plus the requested format name, but the names are Qt image writer names, which are file extensions. Two fork commits:utils: Move the screenshot MIME type into a helper(no change in behaviour) andutils: Label screenshots with the real MIME type, which maps the writer's format names to their registered types and keepsimage/plus the name for anything else. This PR moves the submodule to them, as fix: reject over-deep pre-auth websocket frames #477 did for [crash] obs-websocket: deeply nested JSON/MsgPack payload overflows the stack pre-auth #99.application/octet-stream. With an emptyXDG_DATA_DIRS, a QMimeDatabase version of this fix fails 4 of these 5 cases.One commit, because the fix is already merged in obs-rust/obs-websocket#6: it adds
test_ws_image_mimeand moves the submodule from a4040cb (master's current pin, obs-rust/obs-websocket#9) to 3e46553, the merge of #6 on top of it, so #9 is kept.test_ws_image_mimebuilds the helper from the plugin source on its own (no libobs, no Qt, no display). Cases:image/jpeg;image/x-portable-pixmap;image/vnd.microsoft.icon;image/jpeg,image/pngandimage/bmp.A separate RED commit would have had to point the submodule at the fork's helper-only commit (ff19a05), which predates #9 and would have undone it, so the RED run is shown against that commit instead (below).
Motivation and Context
Fixes #523 (upstream obsproject/obs-websocket#1298, reported by cmack on Linux). andrewsoncha (obsproject/obs-websocket#1337, Qt's MIME database) and iibaranov-IG (obsproject/obs-websocket#1354,
jpgonly) proposed fixes upstream; both are still open. This one covers every format the image writer offers and does not depend on the system's MIME data.Reproduced in the current release (AppImage 33.0.0-beta6-799), headless over obs-websocket:
jpggivesdata:image/jpg,ppmgivesdata:image/ppm, whilejpeg,pngandbmpare right.Why this one: wrong output from a documented request, reported by a Linux user. It is clearly a bug (
image/jpgis not a registered type), and the fix is small. Demand is low: one reporter, plus the two upstream PRs.How Has This Been Tested?
Automated, in both libobs lanes (
ENABLE_RUST_LIBOBSOFF and ON), on current master:test_ws_image_mimewith the submodule at the fork's helper-only commit ff19a05: 4 of 5 fail (the guard passes). At 3e46553: 5 of 5 pass, in both lanes, also withXDG_DATA_DIRSpointing nowhere. It needs no display and no libraries beyond cmocka, so it is registered on every platform.Not tested: a build of OBS with this obs-websocket, taking a screenshot over the wire. The helper is exactly what
GetSourceScreenshotuses for the label, and the request is otherwise unchanged.Types of changes
Checklist:
🤖 Generated with Claude Code