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

Image data URI support #628

Closed
6 tasks done
matthidinger opened this issue Sep 15, 2017 · 4 comments
Closed
6 tasks done

Image data URI support #628

matthidinger opened this issue Sep 15, 2017 · 4 comments

Comments

@matthidinger
Copy link
Member

matthidinger commented Sep 15, 2017

Release Renderer status Tasks status
1.2 ✔️ .NET (#2131)
✔️ Android (#2129)
✔️ iOS (#2130)
✔️ TS (#2442)
✔️ UWP (#2128)
✔️ Shared (#2127)

Solves requests

Solution

The data URI scheme is a uniform resource identifier (URI) scheme that provides a way to include data in-line in web pages as if they were external resources.

Schema

Updated support on all image url properties to support data urls

AdaptiveCard

Property Type Required Description
backgroundImage string false An image to use as the background of the card. Supports data URI.

Image

Property Type Required Description
url string false The URL to the image. Supports data URI.

Action

Property Type Required Description
iconUrl string false The URL to the image. Supports data URI.

Example

Note: this already works in the HTML renderer since browsers support this. We would need to add support in the other renderers.

{
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "Image",
            "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAABfUlEQVRIS72UPU/DMBRF+69hYaJIbBUjfwFRkFCLKFH4iBQWOpeJbMBG5kzGJ+pLbOeFhKbhSkdW/O57t07dTowx/4K6OQaNjfXry9rK7IHInRuGaA011EM0n4PMrkLSNF1bzAhchEGaaTCceuegz68Pdb+NnYI2mzcay1WrazDfC0qSp06KoqCxXLW6BvOrIM0QIqcR8az5Qqz6BXFNGSqnEfHMPnWtT7Dyg57jRxPHcbnyhYeDu4SfPmYIDwm/WydICqvovlwJzvMcU2/hp09mCVbNoOhuVRn+EoaPHj6oILOs6iC36JoxdoVpIS5WfpCEhGHhbQtF3fW7MMuqeSKNLMswt4q61idY1UHL5cK0Eb467VnrE6z6Bck15+pyQdhj5RlRD3tcrLqDeMfyJ6rV2aeOT6uDF3Rze2WuF/uHuV6QZtoXXpBNPmeTT/Ab7itpq7NKyOV8fuAFAVdxWxzMds67zPaCYHY2O52eTM1Avo+OD8uTCF7IeJjJD3xajPLilAzRAAAAAElFTkSuQmCC",
            "style": "person"
        }
   ]
}

Host Config

No changes.

Down-level impact

Medium. Image is most likely dropped, but rest of card should theoretically display?

Renderer requirements

  1. A renderer MUST parse the URI according to the Data URI spec
  2. A renderer MUST display the image using the same mechanism as a remote image

Auto-generated task status

  • Shared
  • .NET
  • Android
  • iOS
  • TS
  • UWP
@matthidinger matthidinger added this to the v1.1 milestone Sep 15, 2017
@khouzam khouzam removed this from the v1.1 milestone Nov 30, 2017
@mannby
Copy link

mannby commented Jul 24, 2018

Supporting this would enable messaging-style scenarios, where there is no external source to reference.

@andrewleader
Copy link
Contributor

@matthidinger what did you mean on the second renderer requirement, where you said it must "display the image using the same mechanism as a remote image"?

@andrewleader andrewleader changed the title Image adds support for data URIs to encode images into the payload Spec draft: Image data URI support Oct 3, 2018
@andrewleader andrewleader mentioned this issue Feb 20, 2019
13 tasks
@andrewleader andrewleader changed the title Spec draft: Image data URI support Image data URI support Feb 20, 2019
@andrewleader
Copy link
Contributor

Temporarily re-opening for tool sync

@andrewleader
Copy link
Contributor

Closing since all done

paulcam206 added a commit that referenced this issue May 23, 2019
andrewleader added a commit that referenced this issue Jun 7, 2019
* Create Image.md

* Update Image.md

* Update Image.md

* More specs

* Media element

* Trying to get auto generate working

* Closer!

* [Schema] Document data URI

Feature spec #628

* [Schema] Introduce inlineAction

Original spec #147

* Specs auto-generated!

* [Schema] Add ActionSet

Spec #877

* Include marked-schema locally

* Improve formatting of markdown table

* [Schema] Update version description

Make description for version attribute a little more clear about being required for toplevel cards.

Fixes #2958

* [Schema] Add fontType to TextBlock

Spec #1078

* [Schema] Add wrap to ChoiceSet and Toggle

Spec #1887

* Move spec generation to separate module

* Standalone spec generator script

* Auto-update specs on save

* Add some readme's

* Spec updating readme

* Point people to the readme

* 1.2 features

* Move Adaptive Card rendering into the actual spec file

* Started adding action specs

* Generate host config

* More action info

* More ActionSet details

* Mock renderer statuses

* Finished with actions

* Columns

* Start adding backgroundImage

* Started working on schema-with-types

* Testing infrastructure

* Add URI support

* Add required support

* Refactor to class

* Add type references

* Add extending classes

* Add inehritance with referencing base class

* Support multiple types for single property

* Add arrays

* Add tests for arrays of base types

* Add dictionary support

* Generate typed schema schema from typed schema itself

* Add typed schema schema

* Add booleans

* Disallow additional properties

* Add extends and schema to json schema

* Started updating some of the schema

* Support multiple top-level types and other fixes

* Fix not being able to add properties to extended classes

* Add ability to change property name of type property

* Support having a default type that doesn't need type specified

* New classType schema

* Add ContainerStyle enum

* Add VerticalContentAlignment

* Support default and required in schema

* Support any object type

* Update schemas

* Add nullable

* Add any arrays

* Update schemas

* Add shorthands

* Start writing more schema

* Allow type to not be specified at top level

* Infer type names from file name

* Add more schema

* Add marker interfaces

* More elements

* Support recursive directories

* Rename to typed-schema

* Report more useful errors

* Start generating Adaptive Card schema

* Support enums

* Schema starting to work!

* Fix incorrect container property

* Fix extended classes not allowing extended properties

* Rename to src folder

* Adding columns

* Closer to multiple tiers of extending

* Support multiple inheritance

* Throw errors on unknown types

* Rename to BlockElement

* Add FactSet

* Add ImageSet

* Add Input.Text

* Added all inputs

* Add typed classes for the parser

* Create overall Schema type object

* Support loading schema from folder

* Almost got spec generation working with new format!

* Add ActionSet

* Markdown generation is getting there!

* Markdown generation almost done

* Generate enum specs

* Add enum value description support

* Add shorthand property to classes

* Update schema to support shorthand

* Update schema file

* Include lib

* Updated schema

* Add RichTextBlock

* Re-organize

* Change image uris to strings for relative urls

* Add Style property to Card

* Add Action.ToggleVisibility

* Add style to actions

* Remove duplicative BlockElement properties

* Add fallback

* Update wrap property on inputs

* Generated

* Update Input.Text selectAction

* Generate

* Add some versions

* Fix blank allOf

* Added a test that tests our samples

* Add horizontalAlignment to richtextblock

* Add minHeight

* Add minHeight to AdaptiveCard

* Add isVisible

* Update package-lock.json

* Add verticalContentAlignment to Adaptive Card

* Add height to container and columnset

* Add height to Column

* Add height to all elements

* Support overriding properties

* Fix image height property

* Fix overriding of inherited properties

* Update adaptive-card-new.json

* Make Column.items not required

* All samples valid

* Use uri-reference

* Support allowAdditionalProperties

* Allow custom enums

* card.style version = 1.2

* Include build-model

* Correctly display version number in markdown

* Support shorthands in markdown and fix background image version

* Remove generate-specs from website

* Generating site from new schema partially working

* Site generating properties

* Fix schema literals in website properties

* Make inherited detailed properties appear, and fix examples for properties

* Make type appear correctly on markdown tables

* Update toc

* Add new elements

* Re-order version property

* Show type type in type

* Support displaying enum value versions

* Style the default value correctly

* Indicate that type on inlines is required

* Support inline shorthand

* Improve image size documentation

* Fix inlineAction description

* Surface required properties at top of table

* Remove local marked-schema

* Rename BlockElement to Element

* Dispaly uri-reference as uri

* Rename fonttype sample

* Add expense report example

* Update schema file in sample

* Update ExpenseReport to use Submit

* Support case insensitive enums

* Remove generated adaptive card schema

* Make release build schema

* Remove compiled typed-script schema

* Add instruction for generating Adaptive schema

* Remove spec-generator

* Update samples schema test to use correct payload

* Remove specs

* Support multiple schema versions

* UWP test updates for renamed FontType test

* Typo in UWP test app

* Update UWP tests after sample payloads changed

* Add FontType expected tests

* Add readme for schema

* Update Visualizer to reference new schema file and all samples

* Fix iOS referencing old FontTypes payload
@edlaver edlaver mentioned this issue Oct 11, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants