Revision f5bbd1eb
Von Jan Büren vor fast 3 Jahren hinzugefügt
SL/DB/ShopPart.pm | ||
---|---|---|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
sub get_images { |
53 |
my ( $self ) = @_;
|
|
53 |
my ($self, %params) = @_;
|
|
54 | 54 |
|
55 | 55 |
require SL::DB::ShopImage; |
56 | 56 |
my $images = SL::DB::Manager::ShopImage->get_all( where => [ 'files.object_id' => $self->{part_id}, ], with_objects => 'file', sort_by => 'position' ); |
... | ... | |
61 | 61 |
# file->extension should be in SL::File, a valid extension may also be 'tar.gz' |
62 | 62 |
my ($path, $extension) = split(/\.([^\.]+)$/, $file->file_name); |
63 | 63 |
my $content = File::Slurp::read_file($file->get_file); |
64 |
my $temp ={ ( link => 'data:' . $file->mime_type . ';base64,' . MIME::Base64::encode($content, ""), #$content, # MIME::Base64::encode($content), |
|
64 |
|
|
65 |
my $temp ={ ( |
|
66 |
link => $params{want_binary} ? $content : 'data:' . $file->mime_type . ';base64,' . MIME::Base64::encode($content, ""), |
|
65 | 67 |
description => $img->file->title, |
66 | 68 |
position => $img->position, |
67 | 69 |
extension => $extension, |
Auch abrufbar als: Unified diff
ShopPart::get_images um Parameter binary anstatt base64 erweitert