-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #681 from simonihmig/support-aspect-ratio
Support aspect ratio parameter correctly
- Loading branch information
Showing
20 changed files
with
454 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@responsive-image/vite-plugin': patch | ||
'@responsive-image/webpack': patch | ||
--- | ||
|
||
Support `aspect` ratio parameter correctly | ||
|
||
When `aspect` is given (via import query params), the height of the image is adjusted to match when resizing, and the image component will correctly render with the new aspect ratio, rather than that of the original image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import Controller from '@ember/controller'; | ||
import dogImage from '../images/aurora.jpg?responsive'; | ||
import dogImageLqipColor from '../images/aurora.jpg?lqip=color&responsive'; | ||
import dogImageLqipInline from '../images/aurora.jpg?lqip={"type":"inline","targetPixels":16}&responsive'; | ||
import dogImageLqipBlurhash from '../images/aurora.jpg?lqip={"type":"blurhash","targetPixels":16}&responsive'; | ||
import image from '../images/aurora.jpg?responsive'; | ||
import imageLqipColor from '../images/aurora.jpg?lqip=color&responsive'; | ||
import imageLqipInline from '../images/aurora.jpg?lqip={"type":"inline","targetPixels":16}&responsive'; | ||
import imageLqipBlurhash from '../images/aurora.jpg?lqip={"type":"blurhash","targetPixels":16}&responsive'; | ||
import imagePortrait from '../images/aurora.jpg?aspect=2:3&responsive'; | ||
import imageGray from '../images/aurora.jpg?grayscale&responsive'; | ||
|
||
export default class IndexController extends Controller { | ||
dogImage = dogImage; | ||
dogImageLqipColor = dogImageLqipColor; | ||
dogImageLqipInline = dogImageLqipInline; | ||
dogImageLqipBlurhash = dogImageLqipBlurhash; | ||
image = image; | ||
imageLqipColor = imageLqipColor; | ||
imageLqipInline = imageLqipInline; | ||
imageLqipBlurhash = imageLqipBlurhash; | ||
imagePortrait = imagePortrait; | ||
imageGray = imageGray; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.