Issue Bug Closed

#82057file:current:crop does not work anymore for page media resources

Markus Timtner 08/08/17, 11:38 updated 10/02/18, 10:59

Description

If one adds an image in page media resources and decides to crop it,
the cropping data isn’t passed through “data” anymore.

This used to work in v7!

References:
http://www.typo3-probleme.de/2017/02/01/typo3-7-6-seiteneigenschaften-bild-ressourcen-via-fluid-auslesen-1897/
http://www.typo3forum.net/discussion/78240/menue-der-unterseiten-mit-bild-jetzt-fuer-fluid-styled-content-und-richtigem-ausschnitt-crop

For Testing, I have this fsc Tempate for MenuAbstract:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">

    <f:if condition="{menu}">
        <ul>
            <f:for each="{menu}" as="page">
                <li>
                    <a href="{page.link}" target="{page.target}" title="{page.title}">
                        <span>{page.title}</span>
                    </a>
                    <f:if condition="{page.data.abstract}">
                        <f:format.html>{page.data.abstract}</f:format.html>
                    </f:if>
                    <f:if condition="{page.data.media}">
                        <f:debug title="My Debug Statement" inline="1">{page}</f:debug>
                        <f:cObject typoscriptObjectPath="lib.pageimage" data="{page.data}"  />
                    </f:if>

                </li>
            </f:for>
        </ul>
    </f:if>

</f:section>
</html>

And this typoscript here:

lib.pageimage = FILES
lib.pageimage {
        references {
            table = pages
            #Seiten-ID ubergabe
            uid.dataWrap= {field:uid}
            fieldName = media
        }
        renderObj = IMAGE
        renderObj {
            file {
                treatIdAsReference = 1
                width       = 780c
                #height      = 380c
                import.data = file:current:uid
                crop.data   = file:current:crop
            }
            #altText.data = file:current:alternative
            altText.data = file:current:crop
            params = class="img-responsive"
            wrap = |
        }
    }
}

For testing, I have the contents of “file:current:crop” in altText.data, which yields:

alt=',"selectedRatio":"NaN","focusArea":null}}'

The same typoscript works in v7 as expected, altText.data shows this result:

alt="{&quot;x&quot;:207.1372549019608,&quot;y&quot;:105.4656862745098,&quot;width&quot;:265,&quot;height&quot;:165.5,&quot;rotate&quot;:0}"

Anybody any ideas?
If someone can point me in the right direction I will have a look.

Reviews 2