X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FShopPart.pm;h=7c67bb1a367fe8b43a891526d66837c4621cc89a;hb=953b505f3da71b5de15e21f812f06f4d6e6f2721;hp=190aa2b1485fec98281168aaec7892c56262affe;hpb=faec06a4f25d238cd2fd5807a0b7d4259c51e6a7;p=kivitendo-erp.git diff --git a/SL/DB/ShopPart.pm b/SL/DB/ShopPart.pm index 190aa2b14..7c67bb1a3 100644 --- a/SL/DB/ShopPart.pm +++ b/SL/DB/ShopPart.pm @@ -50,7 +50,7 @@ sub get_tax_and_price { } sub get_images { - my ( $self ) = @_; + my ($self, %params) = @_; require SL::DB::ShopImage; my $images = SL::DB::Manager::ShopImage->get_all( where => [ 'files.object_id' => $self->{part_id}, ], with_objects => 'file', sort_by => 'position' ); @@ -61,7 +61,9 @@ sub get_images { # file->extension should be in SL::File, a valid extension may also be 'tar.gz' my ($path, $extension) = split(/\.([^\.]+)$/, $file->file_name); my $content = File::Slurp::read_file($file->get_file); - my $temp ={ ( link => 'data:' . $file->mime_type . ';base64,' . MIME::Base64::encode($content, ""), #$content, # MIME::Base64::encode($content), + + my $temp ={ ( + link => $params{want_binary} ? $content : 'data:' . $file->mime_type . ';base64,' . MIME::Base64::encode($content, ""), description => $img->file->title, position => $img->position, extension => $extension,