No images generated in media folder

media

#1

I’m new to Kirby 3 and run into an issue. Images aren’t properly generated in the media folder. The images src in my template seems to be properly generated but the media folder does not contain the corresponding images. The folder is writable. An ideas ? I haven’t found any documentation on the kirby website regarding the media folder or kirby 3 thumbnailing.


#2

When accessing the panel the panel-related stuff gets properly generated. But not for the pages.


#3

A few questions to narrow this down:

  • What exact Kirby 3 version are you using?
  • Are you using any plugins? If yes, which ones?
  • Do you have any config settings reading thumbs in your config.php - or custom folder setup?

#4

I’m using Kirby 3.0.3 with no plugins and no custom folder setup.
My config only contains :

	return [
	    'debug' => true,
	    'languages' => true,
        'date.handler' => 'strftime'
	];

#5

Have you checked if it works without the date.handler setting?


#6

Yes. Doesn’t work either.


#7

And could you share your template code? Maybe something in there.


#8
<?php if ($cover = $item->images()->first()): ?>
<figure class="work-home__cover">
     <img src="<?= $cover->url() ?>" alt="" />
</figure>
<?php endif ?>

and the output

<figure class="work-home__cover">
     <img src="http://127.0.0.1:8000/media/pages/work/project-1/3792425216-1552049473/cover.png" alt="" />
</figure>

#9

Have you used the panel? Are the files for the panel created in the media folder?


#10

Yes. They are created as intended.


#11

I’m out of ideas right now :confused:


#12

Me too. I’ve reinstalled Kirby. Still, same problem. When i access the panel the corresponding files are created in the media folder but not when i access a page containing an image.


#13

Do you get any errors in the console when you use the Panel. Or also have you checked your PHP error log for any hints?


#14

I have the same issue on a docker server using nginx. Are you by any chance also using nginx? Switching to apache works, but is not a real solution.


#16

Im on OSX 10.13.6 using gulp-connect 5.7.0 to create a webserver.
I’m running PHP 7.2.10.


#17

With gulp-connect, you have to use the router.php provided by Kirby: Media is not correctly being generated


#18

Thats what i thought but did not found the corresponding file ‘router.php’. Thank you.


#19

@danielschmid Let us know if it works with these changes.


#20

It works. You have to specify a custom ‘router’ like this :

gulp.task('connect', () => {
    gulpConnect.server({
        base: 'public',
        port: 8000,
        router: 'public/kirby/router.php'
    });
});

Thanks @texnixe