1

Despite having tried the tips from Image transforms returning cpresources url, I am still having issues with image-transforms.

the problem is when i put the image without transform it work fine, but when i add the transform parametre it vanish, and even i tried to apply transfom in the template, the image show up but without crop option, only adjust the width and height in the front.

I have tried clearing the cache and db table already as well as updating the asset index. I have double checked the sources paths and it is not a file permission issue.

I am running Craft Pro 2.6.2992

'generateTransformsBeforePageLoad' => true is set in craft/config/general.php

template-code :

          {% set  blocWith = "large-12" %}
          {% if block.image.first.url is defined %}
          {% set imageUrl = block.image.first.getUrl('imagewidthlarge') %}
          {% set imageHeight = block.image.first.getHeight('imagewidthlarge') %}
          {% set imageWidth = block.image.first.getWidth('imagewidthlarge') %}

      {% endif %}
              <img src="{{ imageUrl ?? '404' }}" height="{{ imageHeight }}" width="{{ imageWidth }}"/>
              <div class="textBloc">
                {% if block.heading is not empty %}<h2 class="m-b-20" style="color:{{ block.textColor }} !important" >{{ block.heading }}</h2>{% endif %}
                {% if block.subtitle is not empty %}<h3 class="m-b-20"style="color:{{ block.textColor }} !important" >{{ block.subtitle }}</h3>{% endif %}
                {{ include(template_from_string(block.text)|raw) }}

this is what the page-source looks like

<img src="http://my-site.dev:8080/fr/cpresources/404?x=24sONoMIB" height="483" width="1202">

vu front : enter image description here

please i'm on a deadline on this projects i tryied all i could to work it out but still, i need this image transform to work

1

I did find the solution i checked the basepath with the server hosting my project and it turned out that the relative path dosen't work like the absolute path, so i serached for the root in the server and i inserted the full path, it work !! thanks for letting me know this by myself :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.