Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 408b3d93

Von Jan Büren vor etwa 3 Jahren hinzugefügt

  • ID 408b3d93b17f72d87bd94a56144dba0214d385a6
  • Vorgänger e060d53e
  • Nachfolger 658d8868

ShopPart::get_images um Parameter binary anstatt base64 erweitert

Unterschiede anzeigen:

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