Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow not embedding local file #625

Merged
merged 4 commits into from
Sep 20, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions panel/pane/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class ImageBase(DivPaneBase):
provide their own way of obtaining or generating a PNG.
"""

embed = param.Boolean(default=False, doc="""
Whether to embed the image as base64 if provided a URL.""")
embed = param.Boolean(default=True, doc="""
Whether to embed the image as base64.""")

imgtype = 'None'

Expand Down Expand Up @@ -82,7 +82,7 @@ def _get_properties(self):
elif self.height is not None:
width = int((self.height/height)*width)
height = self.height
if self._is_url(self.object) and not self.embed:
if self.embed:
src = self.object
else:
b64 = base64.b64encode(data).decode("utf-8")
Expand Down