You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Thorsten Scherler <th...@juntadeandalucia.es> on 2009/07/23 11:43:23 UTC
Preview in resource module
Hi all,
I have a question re the preview of the resource module.
I found in the modules xslt
src/modules/resource/xslt/resource2xhtml.xsl
the call to <xsl:template name="preview"> from
src/modules/resource/xslt/common/mimetype.xsl
where we see whether the width is set.
Only if we have a jpg we call the svg module to ask for
reduction/resizing of the image with adding
"?lenya.module=svg&height=300&width=400" to the image.
This AFAIR because the other are simply not supported, right?
Since I need the resizing as well for gif and other formats I changed
the code to include a url that goes through the image reader of cocoon
which allows you the resize on the fly.
However I do not seem to get the internal link to the media document
right. So I did some debug testing and added the following static
(specific for my environment):
<map:match pattern="x">
<!-- <map:read type="image"
src="/home/thorsten/Pictures/cimg5152.jpg"/>-->
<!--<map:read type="image"
src="http://localhost:8888/festivales/authoring/teatro/clasico/test/galeria/sop.jpg"/>-->
<map:read type="image"
src="lenya-document:08191060-7721-11de-af1e-f8bf12b17365,lang=es,pub=festivales,area=authoring"/>
</map:match>
The first two are working like a charm the third one does not. So my
question is what is the correct way to call the file "behind" a media
within the sitemap so I can use it as a source for my reader?
salu2
--
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>
Sociedad Andaluza para el Desarrollo de la Sociedad
de la Información, S.A.U. (SADESI)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Preview in resource module
Posted by Vik Tara <vi...@propco.co.uk>.
On 23/07/09 18:05, Rudolf Korhummel wrote:
>>
>> I am planning that this module will get documented on the lenya wiki (as
>> soon as time allows...)
>
> Great !
>
> Best
>
> Rudolf
In the meantime feel free to post to the list if anyone has a
requirement to process images.
Regards
Vik
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Preview in resource module
Posted by Rudolf Korhummel <ru...@korhummel.de>.
Hi Vik,
Am 23.07.2009 um 13:18 schrieb Vik Tara:
> Thorsten Scherler wrote:
>> On Thu, 2009-07-23 at 12:02 +0100, Vik Tara wrote:
>>>> Since I need the resizing as well for gif and other formats I
>>>> changed
>>>> the code to include a url that goes through the image reader of
>>>> cocoon
>>>> which allows you the resize on the fly.
>>> I don't think Cocoon's image reader supports any other file types
>>> than
>>> jpg does it?
>>
>> Yeah, there is something back in my head that agrees, however I am
>> not
>> sure anymore where I read the headsup.
>
> This is the main reason why we stopped using imagereader in our pubs:
> http://cocoon.apache.org/2.1/userdocs/core/image-reader.html
>
> See Bugs/Caveats
>
>>
>>> For more complex image handling, we have created a module that
>>> uses jmagick:
>>> http://sourceforge.net/projects/jmagick/
>>>
>>> Let me know if that would help you?
>>
>> Yes, to see your approach that would come in handy. Since I had to do
>> the project in record time from ground up, I may say that for now we
>> support only jpg and if they want other format as well it will come
>> in
>> the next version of their pub.
>
> In simple terms, we just created an ImageMagickReader which can call
> functions from JMagick.
>
> JMagick itself is a JNI based wrapper for ImageMagick - so using this
> approach gives you the ability to call a lot of imagemagick functions.
>
> I am planning that this module will get documented on the lenya wiki
> (as
> soon as time allows...)
Great !
Best
Rudolf
>
>
> Vik
>
>
>>
>> Thanks vik.
>>
>> salu2
>>
>>>
>>> Regards
>>>
>>>
>>> Vik
>>>
>>> Thorsten Scherler wrote:
>>>> Hi all,
>>>>
>>>> I have a question re the preview of the resource module.
>>>>
>>>> I found in the modules xslt
>>>> src/modules/resource/xslt/resource2xhtml.xsl
>>>>
>>>> the call to <xsl:template name="preview"> from
>>>> src/modules/resource/xslt/common/mimetype.xsl
>>>>
>>>> where we see whether the width is set.
>>>>
>>>> Only if we have a jpg we call the svg module to ask for
>>>> reduction/resizing of the image with adding
>>>> "?lenya.module=svg&height=300&width=400" to the image.
>>>>
>>>> This AFAIR because the other are simply not supported, right?
>>>>
>>>> Since I need the resizing as well for gif and other formats I
>>>> changed
>>>> the code to include a url that goes through the image reader of
>>>> cocoon
>>>> which allows you the resize on the fly.
>>>>
>>>> However I do not seem to get the internal link to the media
>>>> document
>>>> right. So I did some debug testing and added the following static
>>>> (specific for my environment):
>>>> <map:match pattern="x">
>>>> <!-- <map:read type="image"
>>>> src="/home/thorsten/Pictures/cimg5152.jpg"/>-->
>>>>
>>>> <!--<map:read type="image"
>>>> src="http://localhost:8888/festivales/authoring/teatro/clasico/test/galeria/sop.jpg
>>>> "/>-->
>>>>
>>>> <map:read type="image"
>>>> src="lenya-document:08191060-7721-11de-af1e-
>>>> f8bf12b17365,lang=es,pub=festivales,area=authoring"/>
>>>> </map:match>
>>>>
>>>> The first two are working like a charm the third one does not.
>>>> So my
>>>> question is what is the correct way to call the file "behind" a
>>>> media
>>>> within the sitemap so I can use it as a source for my reader?
>>>>
>>>> salu2
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Preview in resource module
Posted by Vik Tara <vi...@propco.co.uk>.
Thorsten Scherler wrote:
> On Thu, 2009-07-23 at 12:02 +0100, Vik Tara wrote:
>>> Since I need the resizing as well for gif and other formats I changed
>>> the code to include a url that goes through the image reader of cocoon
>>> which allows you the resize on the fly.
>> I don't think Cocoon's image reader supports any other file types than
>> jpg does it?
>
> Yeah, there is something back in my head that agrees, however I am not
> sure anymore where I read the headsup.
This is the main reason why we stopped using imagereader in our pubs:
http://cocoon.apache.org/2.1/userdocs/core/image-reader.html
See Bugs/Caveats
>
>> For more complex image handling, we have created a module that uses jmagick:
>> http://sourceforge.net/projects/jmagick/
>>
>> Let me know if that would help you?
>
> Yes, to see your approach that would come in handy. Since I had to do
> the project in record time from ground up, I may say that for now we
> support only jpg and if they want other format as well it will come in
> the next version of their pub.
In simple terms, we just created an ImageMagickReader which can call
functions from JMagick.
JMagick itself is a JNI based wrapper for ImageMagick - so using this
approach gives you the ability to call a lot of imagemagick functions.
I am planning that this module will get documented on the lenya wiki (as
soon as time allows...)
Vik
>
> Thanks vik.
>
> salu2
>
>>
>> Regards
>>
>>
>> Vik
>>
>> Thorsten Scherler wrote:
>>> Hi all,
>>>
>>> I have a question re the preview of the resource module.
>>>
>>> I found in the modules xslt
>>> src/modules/resource/xslt/resource2xhtml.xsl
>>>
>>> the call to <xsl:template name="preview"> from
>>> src/modules/resource/xslt/common/mimetype.xsl
>>>
>>> where we see whether the width is set.
>>>
>>> Only if we have a jpg we call the svg module to ask for
>>> reduction/resizing of the image with adding
>>> "?lenya.module=svg&height=300&width=400" to the image.
>>>
>>> This AFAIR because the other are simply not supported, right?
>>>
>>> Since I need the resizing as well for gif and other formats I changed
>>> the code to include a url that goes through the image reader of cocoon
>>> which allows you the resize on the fly.
>>>
>>> However I do not seem to get the internal link to the media document
>>> right. So I did some debug testing and added the following static
>>> (specific for my environment):
>>> <map:match pattern="x">
>>> <!-- <map:read type="image"
>>> src="/home/thorsten/Pictures/cimg5152.jpg"/>-->
>>>
>>> <!--<map:read type="image"
>>> src="http://localhost:8888/festivales/authoring/teatro/clasico/test/galeria/sop.jpg"/>-->
>>>
>>> <map:read type="image"
>>> src="lenya-document:08191060-7721-11de-af1e-f8bf12b17365,lang=es,pub=festivales,area=authoring"/>
>>> </map:match>
>>>
>>> The first two are working like a charm the third one does not. So my
>>> question is what is the correct way to call the file "behind" a media
>>> within the sitemap so I can use it as a source for my reader?
>>>
>>> salu2
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: user-help@lenya.apache.org
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Preview in resource module
Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Thu, 2009-07-23 at 12:02 +0100, Vik Tara wrote:
> > Since I need the resizing as well for gif and other formats I changed
> > the code to include a url that goes through the image reader of cocoon
> > which allows you the resize on the fly.
>
> I don't think Cocoon's image reader supports any other file types than
> jpg does it?
Yeah, there is something back in my head that agrees, however I am not
sure anymore where I read the headsup.
>
> For more complex image handling, we have created a module that uses jmagick:
> http://sourceforge.net/projects/jmagick/
>
> Let me know if that would help you?
Yes, to see your approach that would come in handy. Since I had to do
the project in record time from ground up, I may say that for now we
support only jpg and if they want other format as well it will come in
the next version of their pub.
Thanks vik.
salu2
>
>
> Regards
>
>
> Vik
>
> Thorsten Scherler wrote:
> > Hi all,
> >
> > I have a question re the preview of the resource module.
> >
> > I found in the modules xslt
> > src/modules/resource/xslt/resource2xhtml.xsl
> >
> > the call to <xsl:template name="preview"> from
> > src/modules/resource/xslt/common/mimetype.xsl
> >
> > where we see whether the width is set.
> >
> > Only if we have a jpg we call the svg module to ask for
> > reduction/resizing of the image with adding
> > "?lenya.module=svg&height=300&width=400" to the image.
> >
> > This AFAIR because the other are simply not supported, right?
> >
> > Since I need the resizing as well for gif and other formats I changed
> > the code to include a url that goes through the image reader of cocoon
> > which allows you the resize on the fly.
> >
> > However I do not seem to get the internal link to the media document
> > right. So I did some debug testing and added the following static
> > (specific for my environment):
> > <map:match pattern="x">
> > <!-- <map:read type="image"
> > src="/home/thorsten/Pictures/cimg5152.jpg"/>-->
> >
> > <!--<map:read type="image"
> > src="http://localhost:8888/festivales/authoring/teatro/clasico/test/galeria/sop.jpg"/>-->
> >
> > <map:read type="image"
> > src="lenya-document:08191060-7721-11de-af1e-f8bf12b17365,lang=es,pub=festivales,area=authoring"/>
> > </map:match>
> >
> > The first two are working like a charm the third one does not. So my
> > question is what is the correct way to call the file "behind" a media
> > within the sitemap so I can use it as a source for my reader?
> >
> > salu2
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
--
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>
Sociedad Andaluza para el Desarrollo de la Sociedad
de la Información, S.A.U. (SADESI)
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org
Re: Preview in resource module
Posted by Vik Tara <vi...@propco.co.uk>.
> Since I need the resizing as well for gif and other formats I changed
> the code to include a url that goes through the image reader of cocoon
> which allows you the resize on the fly.
I don't think Cocoon's image reader supports any other file types than
jpg does it?
For more complex image handling, we have created a module that uses jmagick:
http://sourceforge.net/projects/jmagick/
Let me know if that would help you?
Regards
Vik
Thorsten Scherler wrote:
> Hi all,
>
> I have a question re the preview of the resource module.
>
> I found in the modules xslt
> src/modules/resource/xslt/resource2xhtml.xsl
>
> the call to <xsl:template name="preview"> from
> src/modules/resource/xslt/common/mimetype.xsl
>
> where we see whether the width is set.
>
> Only if we have a jpg we call the svg module to ask for
> reduction/resizing of the image with adding
> "?lenya.module=svg&height=300&width=400" to the image.
>
> This AFAIR because the other are simply not supported, right?
>
> Since I need the resizing as well for gif and other formats I changed
> the code to include a url that goes through the image reader of cocoon
> which allows you the resize on the fly.
>
> However I do not seem to get the internal link to the media document
> right. So I did some debug testing and added the following static
> (specific for my environment):
> <map:match pattern="x">
> <!-- <map:read type="image"
> src="/home/thorsten/Pictures/cimg5152.jpg"/>-->
>
> <!--<map:read type="image"
> src="http://localhost:8888/festivales/authoring/teatro/clasico/test/galeria/sop.jpg"/>-->
>
> <map:read type="image"
> src="lenya-document:08191060-7721-11de-af1e-f8bf12b17365,lang=es,pub=festivales,area=authoring"/>
> </map:match>
>
> The first two are working like a charm the third one does not. So my
> question is what is the correct way to call the file "behind" a media
> within the sitemap so I can use it as a source for my reader?
>
> salu2
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org