webbee 0.7.24__tar.gz → 0.7.25__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {webbee-0.7.24 → webbee-0.7.25}/CHANGELOG.md +6 -0
- {webbee-0.7.24 → webbee-0.7.25}/PKG-INFO +1 -1
- {webbee-0.7.24 → webbee-0.7.25}/pyproject.toml +1 -1
- webbee-0.7.25/src/webbee/__init__.py +1 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/media.py +23 -1
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/tools.py +2 -1
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_result_fits_the_door.py +19 -0
- {webbee-0.7.24 → webbee-0.7.25}/uv.lock +1 -1
- webbee-0.7.24/src/webbee/__init__.py +0 -1
- {webbee-0.7.24 → webbee-0.7.25}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/.github/pull_request_template.md +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/.github/workflows/os-check.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/.github/workflows/publish.yml +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/.gitignore +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/LICENSE +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/PRIVACY.md +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/README.md +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/SECURITY.md +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/assets/architecture.png +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/assets/demo.gif +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/assets/hero.png +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/assets/social-preview.png +0 -0
- {webbee-0.7.24/tests → webbee-0.7.25/ci}/__init__.py +0 -0
- {webbee-0.7.24/src/webbee/intel → webbee-0.7.25/ci/field_gate}/__init__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/drivers.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/fixture.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/fixture_long.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/fixture_wait.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/provision_user.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/registry.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/replay.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/run.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/scenarios_account.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/scenarios_code.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/scenarios_contract.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/scenarios_long.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/scenarios_wait.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/test_drivers.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/test_fixture.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/test_fixture_long.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/test_fixture_wait.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/test_registry.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/test_replay.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/field_gate/wipe.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/ci/os_check.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/dev-webbee +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/install.sh +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/__main__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/_launch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/account.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/active_sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/autoupdate.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/banner_art.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/boot.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/browser.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/checkpoints.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/cli.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/clipboard.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/clipboard_read.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/clipboard_session.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/coding_context.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/commands.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/config.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/consent.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/details.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/events.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/expand.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/frames.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/home.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/home_view.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/http.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/instance_lock.py +0 -0
- {webbee-0.7.24/ci/field_gate → webbee-0.7.25/src/webbee/intel}/__init__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/graph.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/outline.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/query.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/service.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/tree.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/intel/watch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/loop_errors.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/modals.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/mode_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/native_files.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/native_read.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/newtab_mode.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/output_pane.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/pricing_constants.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/queue_panel.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/reflow.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/remote.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/render.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/repl.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/repo.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/selection.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/session.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/sizing.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/slots.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/stallwatch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/steer.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/stream.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/tab_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/tabs.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/thread.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/tier_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/todo_panel.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/tokens.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/tui.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/update.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/urlopen.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/wallet.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/src/webbee/worktrees.py +0 -0
- {webbee-0.7.24/ci → webbee-0.7.25/tests}/__init__.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/conftest.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_account.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_active_sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_append_file.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_audit_2026_07_25_findings.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_autoupdate.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_checkpoints.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_checkpoints_nested_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_cli.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_clipboard.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_clipboard_read.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_code_map_fresh.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_coding_context.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_commands.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_config.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_cpc_contract_stable.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_cpc_outline.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_cross_loop_token.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_details.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_events.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_expand.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_field_test_1113.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_freeze_fix.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_home.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_home_view.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_home_view_mouse.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_inspect_page.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_instance_lock.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_any_folder.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_cache_and_sync_worker.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_checksum_tree.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_chunker.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_embed.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_folder_1106.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_graph.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_no_numpy.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_query.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_service.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_intel_watch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_launch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_loop_errors.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_marathon.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_modals_e2e.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_mode_and_remote_0_6_8.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_mode_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_native_files.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_newtab_mode.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_packaging.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_probe_cost.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_queue_manage_0337.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_reflow.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_remote_code_reads.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_render.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_repl.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_repo.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_resilient_http.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_review_fixes_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_session.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_session_review_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_sessions.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_sizing.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_slots.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_ssh_guard.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_stallwatch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_steer.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_stream.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tab_bar_stability.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tab_restore_0337.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tabs.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_terminal_ux_0336.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_thread.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tier_invalidation.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tier_store.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_todo_panel.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tokens.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tool_ack.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tools.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tools_eol_cancel_1030.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tools_vision_websearch.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tray_1126.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tui.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_tui_hardening.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_update.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_update_badge_0340.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_urlopen.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_version.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_version_badge_corner.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_voice_outcome.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_wallet.py +0 -0
- {webbee-0.7.24 → webbee-0.7.25}/tests/test_worktrees.py +0 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.25
|
|
4
|
+
|
|
5
|
+
* An image file is decoded through one guarded door: raster formats only (PNG, JPEG, GIF, WEBP, BMP) - never EPS,
|
|
6
|
+
PS or PDF, which the image library hands to an interpreter - and never a canvas over 40 million pixels. Both
|
|
7
|
+
places that read an image (showing it to the model, drawing it in the terminal) go through it.
|
|
8
|
+
|
|
3
9
|
## 0.7.24
|
|
4
10
|
|
|
5
11
|
* A result fits the door that takes it. The gateway takes a body of 1 MB while a result was cut at 4 MB, so a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.25"
|
|
@@ -17,6 +17,28 @@ import threading
|
|
|
17
17
|
from typing import Optional, Tuple
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
# The one door an image file is decoded through (security review 2026-11-27): a file of the workspace is not
|
|
21
|
+
# trusted. Only raster formats are read -- never EPS/PS/PDF, which Pillow hands to Ghostscript, an interpreter --
|
|
22
|
+
# and never a picture whose pixels would not fit in memory (a small file can declare a huge canvas).
|
|
23
|
+
IMAGE_FORMATS = ("PNG", "JPEG", "GIF", "WEBP", "BMP")
|
|
24
|
+
IMAGE_MAX_PIXELS = 40 * 1000 * 1000
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def open_image(source):
|
|
28
|
+
"""A Pillow image of ``source`` (a path or a binary file object), its header read and its pixels not yet.
|
|
29
|
+
Raises ValueError for a format outside ``IMAGE_FORMATS`` or a canvas over ``IMAGE_MAX_PIXELS``."""
|
|
30
|
+
from PIL import Image
|
|
31
|
+
try:
|
|
32
|
+
im = Image.open(source, formats=list(IMAGE_FORMATS))
|
|
33
|
+
except Exception as e:
|
|
34
|
+
raise ValueError("not an image this terminal reads (%s): %s" % (", ".join(IMAGE_FORMATS), type(e).__name__))
|
|
35
|
+
w, h = im.size
|
|
36
|
+
if w * h > IMAGE_MAX_PIXELS:
|
|
37
|
+
im.close()
|
|
38
|
+
raise ValueError("an image of %dx%d is over %d million pixels" % (w, h, IMAGE_MAX_PIXELS // 1000000))
|
|
39
|
+
return im
|
|
40
|
+
|
|
41
|
+
|
|
20
42
|
def play_audio_file(file_path: str, *, block: bool = False) -> Optional[subprocess.Popen]:
|
|
21
43
|
"""Play an audio file (.wav, .mp3, .m4a, .ogg) across macOS, Linux, and Windows.
|
|
22
44
|
|
|
@@ -104,7 +126,7 @@ def render_image_in_terminal(image_path: str, max_cols: int = 60, max_rows: int
|
|
|
104
126
|
# 3. ANSI TrueColor Half-Block Fallback (Works in ANY 24-bit terminal on macOS, Linux, Windows)
|
|
105
127
|
try:
|
|
106
128
|
from PIL import Image
|
|
107
|
-
img =
|
|
129
|
+
img = open_image(image_path).convert("RGB")
|
|
108
130
|
# Scale to max_cols x (max_rows * 2) because each character cell has 2 vertical subpixels (▀)
|
|
109
131
|
w, h = img.size
|
|
110
132
|
aspect = w / max(1, h)
|
|
@@ -1442,7 +1442,8 @@ def shrink_image(raw: bytes, limit: int = IMAGE_MAX_BYTES):
|
|
|
1442
1442
|
try:
|
|
1443
1443
|
import io
|
|
1444
1444
|
from PIL import Image
|
|
1445
|
-
|
|
1445
|
+
from webbee.media import open_image
|
|
1446
|
+
im = open_image(io.BytesIO(raw)) # raster formats only, a bounded canvas
|
|
1446
1447
|
im.load()
|
|
1447
1448
|
if im.mode not in ("RGB", "L"):
|
|
1448
1449
|
flat = Image.new("RGB", im.size, (255, 255, 255))
|
|
@@ -58,3 +58,22 @@ def test_a_small_image_goes_as_it_is(tmp_path):
|
|
|
58
58
|
|
|
59
59
|
def test_what_cannot_be_shrunk_is_left_to_the_cut(monkeypatch):
|
|
60
60
|
assert T.shrink_image(b"not an image at all" * 100) is None
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def test_an_image_is_decoded_through_one_door_raster_only_and_bounded(monkeypatch):
|
|
64
|
+
"""Security review 2026-11-27: a workspace file is not trusted -- no EPS/PS (Pillow runs Ghostscript on them),
|
|
65
|
+
no canvas that does not fit in memory."""
|
|
66
|
+
pytest.importorskip("PIL.Image")
|
|
67
|
+
import pathlib
|
|
68
|
+
from webbee import media
|
|
69
|
+
eps = b"%!PS-Adobe-3.0 EPSF-3.0\n%%BoundingBox: 0 0 10 10\n%%EndComments\nshowpage\n%%EOF\n"
|
|
70
|
+
with pytest.raises(ValueError):
|
|
71
|
+
media.open_image(io.BytesIO(eps))
|
|
72
|
+
assert T.shrink_image(eps * 20000) is None
|
|
73
|
+
assert not {"EPS", "PDF", "TIFF"} & set(media.IMAGE_FORMATS)
|
|
74
|
+
monkeypatch.setattr(media, "IMAGE_MAX_PIXELS", 1000)
|
|
75
|
+
with pytest.raises(ValueError):
|
|
76
|
+
media.open_image(io.BytesIO(_noise_png(64)))
|
|
77
|
+
src = pathlib.Path(media.__file__).parent
|
|
78
|
+
opens = [f.name for f in src.glob("*.py") if "Image.open(" in f.read_text(encoding="utf-8")]
|
|
79
|
+
assert opens == ["media.py"] # nobody decodes an image beside the door
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.7.24"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|