THUMB isn't working with me

I’m using thumb in a loop, My logic could be wrong and thus the thumb isn’t generating anything on HTML side but rather making the page display a blank page.

Here’s the code :smile:

<?php foreach(page('products')->children()->visible() as $project): ?>
<?php foreach($project->images()->sortBy('sort', 'asc') as $image): ?>
	<li class="mix <?php echo $project->slug() ?>">
		<a href="<?php echo $image->url() ?>" class="swipebox" title="<?php echo $image->productname() ?>">
			<img src="<?php echo thumb($image, array('width'=>'400px'))->url() ?>" alt="<?php echo $project->title()->html() ?>"><span>
			<?php if(!$image->productname()->empty()): ?>
			  <?php echo $image->productname()->kirbytext() ?>
			  <?php else:?>
			  <?php echo "Please add a title from the panel" ?>
			<?php endif ?>
			</span>
		</a>
	</li>
<?php endforeach ?>
<?php endforeach ?>

Removing the second Foreach loop works with the thumb but then it just takes out the very first image of the page and yes the thumb did created files in the folder.

The code looks alright, but if you get a blank page, you should turn on debugging or/and check the server error logs.

Tried that but no errors on the page, It’s just blank white.

Here’s where i added that debug code.

Link to image

Sometimes you don’t get a debugging error, that’s when it is useful to consult the server php error logs as well

I removed everything from the loop apart from the img code where it displays the thumb, Now i am able to open the page but with errors

<img src="<br />
<b>Fatal error</b>:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 1729 bytes) in <b>/home/website/public_html/work/portfolio/admin/kirby/toolkit/vendors/abeautifulsite/SimpleImage.php</b> on line <b>1110</b><br />

Problem solved.

Increased the memory limit to 128M since even 64M wasn’t working and website is super fast now :smiley:

Hey @NMindz_, can you expand on that?

Where did you increase the memory limit? I’m dealing with a similar issue.

In your php.ini or using ini_set('memory_limit', '128M'); in your config.php.