Skip to content

fix bitmap_from_file method in utils.py#2700

Merged
jmcouffin merged 3 commits intopyrevitlabs:developfrom
jaredholloway94:patch-1
Jun 11, 2025
Merged

fix bitmap_from_file method in utils.py#2700
jmcouffin merged 3 commits intopyrevitlabs:developfrom
jaredholloway94:patch-1

Conversation

@jaredholloway94
Copy link
Copy Markdown
Contributor

@jaredholloway94 jaredholloway94 commented Jun 9, 2025

Fix bitmap_from_file method in utils.py

Description

Explicitly provide UriKind to Uri constructor in bitmap_from_file method.


Checklist

Before submitting your pull request, ensure the following requirements are met:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

Related Issues

If applicable, link the issues resolved by this pull request:

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Jun 9, 2025

Unable to perform a code review. You have run out of credits 😔
You can buy additional credits from the subscription page.

@jmcouffin jmcouffin requested a review from Copilot June 9, 2025 19:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fix explicit UriKind usage in bitmap_from_file to ensure proper BitmapImage.UriSource initialization.

  • Imported Uri and UriKind from pyrevit.framework
  • Updated bitmap.UriSource assignment to use Uri.TryCreate with UriKind.RelativeOrAbsolute
Comments suppressed due to low confidence (1)

pyrevitlib/pyrevit/forms/utils.py:11

  • The docstring states absolute path, but UriKind.RelativeOrAbsolute allows relative paths. Update the description to reflect support for both, or enforce only absolute URIs.
bitmap_file (str): absolute path to bitmap file

@jmcouffin jmcouffin added the API Change Revit API change that breaks pyRevit [class->Upgraded #{number}: {title}] label Jun 9, 2025
@jaredholloway94
Copy link
Copy Markdown
Contributor Author

@jmcouffin what do the emojis mean?

@jmcouffin
Copy link
Copy Markdown
Contributor

@jmcouffin what do the emojis mean?

If you mean this one ☝️
Just to consider the comments from GitHub copilot review as they make sense.

The other ones on your original post, not much more than thanks, I will look at it and test whenever I get the time.

add error handling for Uri.TryCreate in bitmap_from_file method

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jmcouffin jmcouffin merged commit 95e6046 into pyrevitlabs:develop Jun 11, 2025
@jmcouffin
Copy link
Copy Markdown
Contributor

jmcouffin commented Jun 11, 2025

Thanks @jaredholloway94.
You are gently becoming a regular!

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1306-wip

@jaredholloway94
Copy link
Copy Markdown
Contributor Author

Thanks @jaredholloway94.

You are gently becoming a regular!

trying!
glad to have my first PR merged.
thanks for the support.

@jaredholloway94 jaredholloway94 deleted the patch-1 branch June 11, 2025 14:42
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+2030-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+0700-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1347-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1420-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1830-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25171+0757-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25181+1313-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New public release are available for 5.2.0.25181+1425

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Change Revit API change that breaks pyRevit [class->Upgraded #{number}: {title}]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: pyrevit.forms.WPFWindow.set_icon method fails with valid file path; requires formatted Uri

3 participants