Jump to content

Images resized to 0x0px for non - superusers


lecrackffm
 Share

Recommended Posts

Hi everyone, 

currently im developing a photographer portfolio-website.

Since i deployed it to a live server the API creates a 0x0 version of the each image, which are then correctly downloaded by the browser. 

(Instead of the appropriate image, specified in the CSS)

However, this only happens for guests and other Users (non-superusers).

Oddly, this only happens on the homepage. On all other pages, the Images are loaded correctly. I already checked the permissions in processwire and on the server. Afaik they are all correct, allthough i am not the biggest expert in that regard.

Any help / ideas are highly appreciated 🙂

 

Link to comment
Share on other sites

@wbmnfktr sure, here is the code.

<?php $items = page()->repeater_home_gallery; ?>
<?php foreach ($items as $i):   
	$ratio = $i->gallery_ratio->title;
    		switch ($ratio) {
             case "portrait":
                $w_l = 494;
                $h_l = 618;
                break;
              case "quad":
                $w_l = 494;
                $h_l = 494;
                break;
              case "normal":
                $w_l = 494;
                $h_l = 330;
                break;
            }
    $image = $i->image_single->size($w_l, $h_l)->url;
?>
 <img class="uk-width" src="<?= $image ?>"  >
<?php endforeach; ?>

What grinds my gears is that it works on localhost.. 

Link to comment
Share on other sites

Ah. Finally got it!!

It was indeed a permission. Stupid me removed the permission to view the "gallery-ratio" field on the live system..

Damn, this took me hours to find out.. but anyways.

Have an nice weekend 🙂

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By sebr
      Hi
      On Processwire 3.0.179
      Create a fieldtype image named "img_test" with option "Use custom fields" On the template "field-img_text" add a title field On a repeater matrix, add a new type with the field "img_test" Add the repeater matrix on basic-page Create a new page and add an image in the repeater matrix, in the field img_test and fill in the title field from the image field Save and reload : the title field from img_test in the repeater matrix is empty In older Processwire versions, the first time I saved this custom fields were not saved, but on the second one, yes.
      Any idea about it ? A bug or a bad setting ?
    • By sebr
      Hello
      One of my customers needs to have his site translated by a publisher. He asks me if it is possible to create a role that could only edit the German version of the pages, without permission on the English version.
      I haven't found any permission related to this need, but maybe it's possible from a hook?
      Thank you for your help
       
×
×
  • Create New...