From 136f23d3be1f43c41596da10e0c9304acae54e55 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Thu, 4 May 2023 00:13:49 +0200 Subject: [PATCH] Replacing previews again to png. --- lib/BurguillosInfo.pm | 2 +- lib/BurguillosInfo/Controller/Page.pm | 2 +- lib/BurguillosInfo/Posts.pm | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/BurguillosInfo.pm b/lib/BurguillosInfo.pm index 46e9d28..52c612e 100644 --- a/lib/BurguillosInfo.pm +++ b/lib/BurguillosInfo.pm @@ -36,7 +36,7 @@ sub startup ($self) { $r->get('/<:category>.rss')->to('Page#category_rss'); $r->get('/:category_slug/atributo/:attribute_slug')->to('Attribute#get'); $r->get('/:category')->to('Page#category'); - $r->get('/posts/<:slug>-preview.webp')->to('Page#get_post_preview'); + $r->get('/posts/<:slug>-preview.png')->to('Page#get_post_preview'); $r->get('/posts/:slug')->to('Page#post'); $r->get('/filtros')->to('Filter#list'); $r->get('/filtros/:slug')->to('Filter#get'); diff --git a/lib/BurguillosInfo/Controller/Page.pm b/lib/BurguillosInfo/Controller/Page.pm index 2c85807..797b32c 100644 --- a/lib/BurguillosInfo/Controller/Page.pm +++ b/lib/BurguillosInfo/Controller/Page.pm @@ -119,7 +119,7 @@ sub post { return; } my $current_category = $categories->{ $post->{category} }; - $self->stash(ogimage => 'https://burguillos.info/posts/'.$post->{slug}.'-preview.webp'); + $self->stash(ogimage => 'https://burguillos.info/posts/'.$post->{slug}.'-preview.png'); $self->stash(useragent => $self->req->headers->user_agent); $self->render( post => $post, current_category => $current_category ); } diff --git a/lib/BurguillosInfo/Posts.pm b/lib/BurguillosInfo/Posts.pm index 27b8326..200d163 100644 --- a/lib/BurguillosInfo/Posts.pm +++ b/lib/BurguillosInfo/Posts.pm @@ -219,7 +219,7 @@ sub PostPreviewOg { my $svg = $self->_GenerateSVGPostPreview( $title, \@new_content, $post->{image} ); my ( $stdout, $stderr ) = capture { - open my $fh, '|-', qw{convert /dev/stdin webp:fd:1}; + open my $fh, '|-', qw{convert /dev/stdin png:fd:1}; binmode $fh, 'utf8'; print $fh $svg; close $fh; @@ -276,7 +276,7 @@ sub _GenerateSVGPostPreview { my $content = shift; my $image = shift; if ($image =~ /\.jpe?g$/) { - my $new_image = $image =~ s/\.jpe?g$/.generated.webp/r; + my $new_image = $image =~ s/\.jpe?g$/.generated.png/r; my $dir = 'public'; if (!-e $new_image) { system 'convert', "$dir/$image", "$dir/$new_image";