Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task<Image> GetImage(string url)
return RtbInlineImageFactory.Create(imageSource.ImageSource, new RtbInlineImageFactory.InlineImageOptions
{
DownscaleOnly = imageSource.Hints.DownscaleOnly ?? true,
FitColumnWidth = imageSource.Hints.FitMode == "fit",
FitColumnWidth = imageSource.Hints.FitMode is null || imageSource.Hints.FitMode.Equals("fit", StringComparison.OrdinalIgnoreCase),
MaxWidthDip = imageSource.Hints.MaxPixelWidth,
MaxHeightDip = imageSource.Hints.MaxPixelHeight,
Comment on lines 23 to 27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed — the FitMode check in ImageProvider now uses StringComparison.OrdinalIgnoreCase, so mixed-case query values still take the fit path.

WidthDip = imageSource.Hints.DesiredPixelWidth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ static string GetContentMarkup(Uri path1, Uri path2)
For URIs that support query parameters (file, http, ms-appx, ms-appdata), you can provide hints to control scaling

- `--x-cmdpal-fit`
- `none`: no automatic scaling, provides image as is (default)
- `fit`: scale to fit the available space
- `fit`: scale to fit the available space (default)
- `none`: no automatic scaling, provides image as is
- `--x-cmdpal-upscale`
- `true`: allow upscaling
- `false`: downscale only (default)
Comment on lines +158 to 161
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a note to the sample Markdown images page calling out that the no-fit sample uses source pixel size, so it can differ from the natural visual size under non-100% DPI scaling.

Expand All @@ -169,18 +169,19 @@ For URIs that support query parameters (file, http, ms-appx, ms-appdata), you ca
## Examples

### No scaling
ℹ️ This sample uses the source pixel size, so under non-100% DPI scaling the rendered size can differ from the image's natural visual size.
```xml
![green rectangle]({{path1}})
![green rectangle]({{path1}}?--x-cmdpal-fit=none)
```

![green rectangle]({{path1}})
![green rectangle]({{path1}}?--x-cmdpal-fit=none)

### Scale to fit (scaling down only by default)
```xml
![green rectangle]({{path1}}?--x-cmdpal-fit=fit)
![green rectangle]({{path1}})
```

![green rectangle]({{path1}}?--x-cmdpal-fit=fit)
![green rectangle]({{path1}})

### Scale to fit (in both direction)
```xml
Expand Down
Loading