Skip to content

Commit

Permalink
FIX: Remove preserveAspect
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmeister committed Jun 20, 2024
1 parent a54b57c commit 60476f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
6 changes: 2 additions & 4 deletions Resources/Private/Fusion/Prototypes/Image.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,15 @@ prototype(Sitegeist.Kaleidoscope:Image) < prototype(Neos.Fusion:Component) {
quality = null
attributes = Neos.Fusion:DataStructure
renderDimensionAttributes = true
preserveAspect = true

renderer = Neos.Fusion:Component {
@if.hasImageSource = ${props.imageSource && Type.instance(props.imageSource, '\\Sitegeist\\Kaleidoscope\\Domain\\ImageSourceInterface')}
isScalableSource = ${props.imageSource && Type.instance(props.imageSource, '\\Sitegeist\\Kaleidoscope\\Domain\\ScalableImageSourceInterface')}

# apply format, width and height to the imageSource
imageSource = ${props.imageSource}
[email protected] = ${(props.width && props.height) ? value.withDimensions(props.width, props.height) : value}
[email protected] = ${(props.width && !props.height) ? value.withWidth(props.width, props.preserveAspect) : value}
[email protected] = ${(props.height && !props.width) ? value.withHeight(props.height, props.preserveAspect) : value}
[email protected] = ${props.width ? value.withWidth(props.width) : value}
[email protected] = ${props.height ? value.withHeight(props.height) : value}
[email protected] = ${props.format ? value.withFormat(props.format) : value}
[email protected] = ${props.quality ? value.withQuality(props.quality) : value}

Expand Down
11 changes: 3 additions & 8 deletions Resources/Private/Fusion/Prototypes/Picture.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ prototype(Sitegeist.Kaleidoscope:Picture) < prototype(Neos.Fusion:Component) {
imgAttributes = Neos.Fusion:DataStructure
content = ''
renderDimensionAttributes = true
preserveAspect = true

#
# put the values that shall be applied to sources automatically to the context
Expand All @@ -86,10 +85,9 @@ prototype(Sitegeist.Kaleidoscope:Picture) < prototype(Neos.Fusion:Component) {

# apply format, width and height to the imageSource
imageSource = ${props.imageSource}
[email protected] = ${(props.width && props.height) ? value.withDimensions(props.width, props.height) : value}
[email protected] = ${(props.width && !props.height) ? value.withWidth(props.width, props.preserveAspect) : value}
[email protected] = ${(props.height && !props.width) ? value.withHeight(props.height, props.preserveAspect) : value}
[email protected] = ${props.format ? value.withFormat(props.format) : value}
[email protected] = ${props.width ? value.setWidth(props.width) : value}
[email protected] = ${props.height ? value.setHeight(props.height) : value}
[email protected] = ${props.format ? value.setFormat(props.format) : value}
[email protected] = ${props.quality ? value.setQuality(props.quality) : value}

srcset = ${props.srcset}
Expand All @@ -104,7 +102,6 @@ prototype(Sitegeist.Kaleidoscope:Picture) < prototype(Neos.Fusion:Component) {
imgAttributes = ${props.imgAttributes}
content = ${props.content}
renderDimensionAttributes = ${props.renderDimensionAttributes}
preserveAspect = ${props.preserveAspect}

renderer = afx`
<picture class={props.class} {...props.attributes}>
Expand All @@ -121,7 +118,6 @@ prototype(Sitegeist.Kaleidoscope:Picture) < prototype(Neos.Fusion:Component) {
srcset={source.srcset ? source.srcset : props.srcset}
sizes={source.sizes ? source.sizes : props.sizes}
renderDimensionAttributes={props.renderDimensionAttributes}
preserveAspect={props.preserveAspect}
/>
</Neos.Fusion:Loop>
<Neos.Fusion:Loop
Expand All @@ -143,7 +139,6 @@ prototype(Sitegeist.Kaleidoscope:Picture) < prototype(Neos.Fusion:Component) {
title={props.title}
attributes={props.imgAttributes}
renderDimensionAttributes={props.renderDimensionAttributes}
preserveAspect={props.preserveAspect}
/>
</picture>
`
Expand Down
8 changes: 3 additions & 5 deletions Resources/Private/Fusion/Prototypes/Source.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ prototype(Sitegeist.Kaleidoscope:Source) < prototype(Neos.Fusion:Component) {
type = null
media = null
renderDimensionAttributes = true
preserveAspect = true

renderer = Neos.Fusion:Component {

Expand All @@ -32,10 +31,9 @@ prototype(Sitegeist.Kaleidoscope:Source) < prototype(Neos.Fusion:Component) {
isScalableSource = ${imageSource && Type.instance(imageSource, '\\Sitegeist\\Kaleidoscope\\Domain\\ScalableImageSourceInterface')}

imageSource = ${imageSource}
[email protected] = ${(props.width && props.height) ? value.withDimensions(props.width, props.height) : value}
[email protected] = ${(props.width && !props.height) ? value.withWidth(props.width, props.preserveAspect) : value}
[email protected] = ${(props.height && !props.width) ? value.withHeight(props.height, props.preserveAspect) : value}
[email protected] = ${props.format ? value.withFormat(props.format) : value}
[email protected] = ${width ? value.withWidth(width) : value}
[email protected] = ${height ? value.withHeight(height) : value}
[email protected] = ${format ? value.withFormat(format) : value}
[email protected] = ${quality ? value.withQuality(quality) : value}

type = ${format ? 'image/' + format : props.type}
Expand Down

0 comments on commit 60476f4

Please sign in to comment.