[Catalyst] display multiple png's simultaneously

2010-01-01 Thread Jürgen Hensch
Hi,

I am developing a small "media bookshelf" where I want to display in a 
matrix-like layout - among other informations - covers in png format (which are 
saved in a BLOB in my Mysql-DB). I have something like [1] in my mind. The 
problem I have now is, that only ONE cover is displayed at a time. The relevant 
code looks like this:

matrix.tt2:
---



[% FOREACH m IN medien %]
 [% IF ! (loop.count mod 4) %]


 [% END %]






[% m.titel %]


[% m.typ %]



[% END %]



Medien.pm:
--

sub cover :Chained('object') :PathPart('cover') :Args(0) {
my ($self, $c) = @_;

my $medium = $c->stash->{object};
$c->response->header('Content-Type' => $medium->mime . "; 
charset=\"ISO-8859-1\"");
$c->response->write($medium->cover);
}

I think I now where the problem is, but I do not know how I can fix it 
properly: The cover action in my Medien controller works with $c->response and 
therefor creates a new response for each object-tag in my tt2. So only the 
"last" cover is displayed.

Can anybody help me on how I get all covers displayed simultaneously?

Thanks

Jürgen

[1] 
http://forum.computerbild.de/attachments/benutzer-tutorials/musikverwaltung-tipps-tricks-problemloesungen-itunes-9073d1232463324-bild6.jpg
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] display multiple png's simultaneously

2010-01-01 Thread Eisenberger Tamás
Hy!

The code, looks good to me, the problem maybe in the action that
captures the argument for the chain, to confirm that, please check that
all the object's data attributes generated right, and check the debug
output for the server to see if all the object's requests, succeeds (
you can see the error messages that catalyst generates for the images,
if you change the object's to iframes... so then the images may display
ugly, but you can see the error messages it they sent instead of an image...

On 01/01/2010 09:30 PM, "Jürgen Hensch" wrote:
> Hi,
>
> I am developing a small "media bookshelf" where I want to display in a 
> matrix-like layout - among other informations - covers in png format (which 
> are saved in a BLOB in my Mysql-DB). I have something like [1] in my mind. 
> The problem I have now is, that only ONE cover is displayed at a time. The 
> relevant code looks like this:
>
> matrix.tt2:
> ---
>
> 
> 
> [% FOREACH m IN medien %]
>  [% IF ! (loop.count mod 4) %]
> 
> 
>  [% END %]
> 
> 
> 
>  height="300">
> 
> 
> [% m.titel %]
> 
> 
> [% m.typ %]
> 
> 
> 
> [% END %]
> 
> 
>
> Medien.pm:
> --
>
> sub cover :Chained('object') :PathPart('cover') :Args(0) {
> my ($self, $c) = @_;
>
> my $medium = $c->stash->{object};
> $c->response->header('Content-Type' => $medium->mime . "; 
> charset=\"ISO-8859-1\"");
> $c->response->write($medium->cover);
> }
>
> I think I now where the problem is, but I do not know how I can fix it 
> properly: The cover action in my Medien controller works with $c->response 
> and therefor creates a new response for each object-tag in my tt2. So only 
> the "last" cover is displayed.
>
> Can anybody help me on how I get all covers displayed simultaneously?
>
> Thanks
>
> Jürgen
>
> [1] 
> http://forum.computerbild.de/attachments/benutzer-tutorials/musikverwaltung-tipps-tricks-problemloesungen-itunes-9073d1232463324-bild6.jpg
>   



smime.p7s
Description: S/MIME Cryptographic Signature
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] display multiple png's simultaneously

2010-01-01 Thread Jürgen Hensch
Hi Tamás,

according to the server's debug output, all images are created correctly (ie. 
the requests succeed). If I switch from the object tag to iframe, all images 
(except the last one which is displayed correctly) produce an error message in 
their iframe's: "Die Grafik http://... kann nicht angezeigt werden, weil sie 
einen Fehler enthält" (Something like "The image http://... cannot be displayed 
because it contains an error.")

Any idea?

 Original-Nachricht 
> Datum: Sat, 02 Jan 2010 00:56:27 +0100
> Von: "Eisenberger Tamás" 
> An: The elegant MVC web framework 
> Betreff: Re: [Catalyst] display multiple png\'s simultaneously

> Hy!
> 
> The code, looks good to me, the problem maybe in the action that
> captures the argument for the chain, to confirm that, please check that
> all the object's data attributes generated right, and check the debug
> output for the server to see if all the object's requests, succeeds (
> you can see the error messages that catalyst generates for the images,
> if you change the object's to iframes... so then the images may display
> ugly, but you can see the error messages it they sent instead of an
> image...
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] display multiple png's simultaneously

2010-01-03 Thread Jürgen Hensch
Hmm, never mind: I don't know *what* I changed, but now it seems to work as 
intended - i.e. *all* covers are displayed simultaneously.

confused greetings

Jürgen
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/