Jump to content
lecrackffm

Images resized to 0x0px for non - superusers

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 🙂

 

Share this post


Link to post
Share on other sites

Can you post the code that is responsible for rendering/creating those images. Maybe there is a glitch in it.

Share this post


Link to post
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.. 

Share this post


Link to post
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 🙂

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...