You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Damjan Jovanovic <da...@apache.org> on 2014/10/23 06:42:32 UTC

[compress][imaging] generalise/publicise commons-compress LZW implementation?

Hi

I've been hoping to steal commons-compress's cleaner and faster LZW
decompressor, and use it in commons-imaging for TIFF and GIF files,
and I've finally managed to make a patch to that effect.

This requires moving LZWInputStream to a
org.apache.commons.compress.compressors.lzw package and making it
public. Any objections to this?

Also imaging would have to depend on a SNAPSHOT of compress to be able
to import LZWInputStream, at least until the next release. Which is
when?

I am attaching patches in case anyone wants to have a look, but I can
commit them myself if there are no objections.

Thank you
Damjan

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2014-10-23, Damjan Jovanovic wrote:

> I've been hoping to steal commons-compress's cleaner and faster LZW
> decompressor, and use it in commons-imaging for TIFF and GIF files,
> and I've finally managed to make a patch to that effect.

Cool.

> This requires moving LZWInputStream to a
> org.apache.commons.compress.compressors.lzw package and making it
> public. Any objections to this?

Which means it would now become a public API, right?  No problem with
it.

> Also imaging would have to depend on a SNAPSHOT of compress to be able
> to import LZWInputStream, at least until the next release. Which is
> when?

The last release happened just two weeks ago and we haven't had any code
changes since then.  I don't see any problem with cutting a small point
release if/once imaging wants to do a release :-)

> I am attaching patches in case anyone wants to have a look, but I can
> commit them myself if there are no objections.

You know the LZW code better than anybody else, go ahead.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 23, 2014 at 8:38 AM, Emmanuel Bourg <eb...@apache.org> wrote:

> Le 23/10/2014 06:42, Damjan Jovanovic a écrit :
>
> > I've been hoping to steal commons-compress's cleaner and faster LZW
> > decompressor, and use it in commons-imaging for TIFF and GIF files,
> > and I've finally managed to make a patch to that effect.
>
> That's great to be able to share the code, thank you for looking at this.
>
> > This requires moving LZWInputStream to a
> > org.apache.commons.compress.compressors.lzw package and making it
> > public. Any objections to this?
>
> I have no objection, but we may want to discuss if BitInputStream should
> belong to this package.
>
> > Also imaging would have to depend on a SNAPSHOT of compress to be able
> > to import LZWInputStream, at least until the next release. Which is
> > when?
>
> When someone wants to release it :)
>
> > I am attaching patches in case anyone wants to have a look, but I can
> > commit them myself if there are no objections.
>
> It looks good to me. There are just some tabs in BitInputStream and an
> import sun.net.www.content.image.gif in GifImageParser.
>

Are you sure about the tabs in BitInputStream? I do not see them... weird.

Gary

>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 23, 2014 at 8:38 AM, Emmanuel Bourg <eb...@apache.org> wrote:

> Le 23/10/2014 06:42, Damjan Jovanovic a écrit :
>
> > I've been hoping to steal commons-compress's cleaner and faster LZW
> > decompressor, and use it in commons-imaging for TIFF and GIF files,
> > and I've finally managed to make a patch to that effect.
>
> That's great to be able to share the code, thank you for looking at this.
>
> > This requires moving LZWInputStream to a
> > org.apache.commons.compress.compressors.lzw package and making it
> > public. Any objections to this?
>
> I have no objection, but we may want to discuss if BitInputStream should
> belong to this package.
>
> > Also imaging would have to depend on a SNAPSHOT of compress to be able
> > to import LZWInputStream, at least until the next release. Which is
> > when?
>
> When someone wants to release it :)
>
> > I am attaching patches in case anyone wants to have a look, but I can
> > commit them myself if there are no objections.
>
> It looks good to me. There are just some tabs in BitInputStream and an
> import sun.net.www.content.image.gif in GifImageParser.
>

Speaking of GifImageParser, there is a possible NPE here:


        if (hasAlpha) {
            transparentIndex = gce.transparentColorIndex;
        }

Fixed in SVN now.

Gary


>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 23, 2014 at 11:32 AM, Emmanuel Bourg <eb...@apache.org> wrote:

> Le 23/10/2014 17:27, Gary Gregory a écrit :
>
> > I do not see the dep, are we looking at the same sources?
>
> I looked at the patch he attached to his mail.
>

Whoops, my bad, sorry.

Gary

>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 23/10/2014 17:27, Gary Gregory a écrit :

> I do not see the dep, are we looking at the same sources?

I looked at the patch he attached to his mail.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 23, 2014 at 8:38 AM, Emmanuel Bourg <eb...@apache.org> wrote:

> Le 23/10/2014 06:42, Damjan Jovanovic a écrit :
>
> > I've been hoping to steal commons-compress's cleaner and faster LZW
> > decompressor, and use it in commons-imaging for TIFF and GIF files,
> > and I've finally managed to make a patch to that effect.
>
> That's great to be able to share the code, thank you for looking at this.
>
> > This requires moving LZWInputStream to a
> > org.apache.commons.compress.compressors.lzw package and making it
> > public. Any objections to this?
>
> I have no objection, but we may want to discuss if BitInputStream should
> belong to this package.
>
> > Also imaging would have to depend on a SNAPSHOT of compress to be able
> > to import LZWInputStream, at least until the next release. Which is
> > when?
>
> When someone wants to release it :)
>
> > I am attaching patches in case anyone wants to have a look, but I can
> > commit them myself if there are no objections.
>
> It looks good to me. There are just some tabs in BitInputStream and an
> import sun.net.www.content.image.gif in GifImageParser.
>

I do not see the dep, are we looking at the same sources?

I ses
https://svn.apache.org/repos/asf/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/gif/GifImageParser.java

Gary

>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Damjan Jovanovic <da...@apache.org>.
On Thu, Oct 23, 2014 at 2:38 PM, Emmanuel Bourg <eb...@apache.org> wrote:
> Le 23/10/2014 06:42, Damjan Jovanovic a écrit :
>
>> I've been hoping to steal commons-compress's cleaner and faster LZW
>> decompressor, and use it in commons-imaging for TIFF and GIF files,
>> and I've finally managed to make a patch to that effect.
>
> That's great to be able to share the code, thank you for looking at this.
>
>> This requires moving LZWInputStream to a
>> org.apache.commons.compress.compressors.lzw package and making it
>> public. Any objections to this?
>
> I have no objection, but we may want to discuss if BitInputStream should
> belong to this package.

An argument could be made for commons-io, it could be merged with
zip's BitStream, or made package-private.

I am also going to re-examine the 4 LZW implementations and see if
they can be structured better before committing.

>> Also imaging would have to depend on a SNAPSHOT of compress to be able
>> to import LZWInputStream, at least until the next release. Which is
>> when?
>
> When someone wants to release it :)
>
>> I am attaching patches in case anyone wants to have a look, but I can
>> commit them myself if there are no objections.
>
> It looks good to me. There are just some tabs in BitInputStream and an
> import sun.net.www.content.image.gif in GifImageParser.

Thank you, nice catch. I had tabs everywhere... fixed now :).

Damjan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 23/10/2014 06:42, Damjan Jovanovic a écrit :

> I've been hoping to steal commons-compress's cleaner and faster LZW
> decompressor, and use it in commons-imaging for TIFF and GIF files,
> and I've finally managed to make a patch to that effect.

That's great to be able to share the code, thank you for looking at this.

> This requires moving LZWInputStream to a
> org.apache.commons.compress.compressors.lzw package and making it
> public. Any objections to this?

I have no objection, but we may want to discuss if BitInputStream should
belong to this package.

> Also imaging would have to depend on a SNAPSHOT of compress to be able
> to import LZWInputStream, at least until the next release. Which is
> when?

When someone wants to release it :)

> I am attaching patches in case anyone wants to have a look, but I can
> commit them myself if there are no objections.

It looks good to me. There are just some tabs in BitInputStream and an
import sun.net.www.content.image.gif in GifImageParser.

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 23/10/2014 23:07, Torsten Curdt a écrit :

> Using the maven-shade-plugin would be the better choice IMO.

+1

Emmanuel Bourg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Torsten Curdt <tc...@vafer.org>.
>
> > > I think it is a good idea make [imaging] depend on [compress].
> >
> > Do you mean depend in general, or as opposed to the current use of the
> > maven-shade-plugin to "half-depend" on it?
> >
>
> I mean plain and simple depend.
>

Using the maven-shade-plugin would be the better choice IMO.

cheers,
Torsten

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 23, 2014 at 1:12 PM, Damjan Jovanovic <da...@apache.org> wrote:

> On Thu, Oct 23, 2014 at 5:05 PM, Gary Gregory <ga...@gmail.com>
> wrote:
> > On Thu, Oct 23, 2014 at 12:42 AM, Damjan Jovanovic <da...@apache.org>
> > wrote:
> >
> >> Hi
> >>
> >> I've been hoping to steal commons-compress's cleaner and faster LZW
> >> decompressor, and use it in commons-imaging for TIFF and GIF files,
> >> and I've finally managed to make a patch to that effect.
> >>
> >> This requires moving LZWInputStream to a
> >> org.apache.commons.compress.compressors.lzw package and making it
> >> public. Any objections to this?
> >>
> >> Also imaging would have to depend on a SNAPSHOT of compress to be able
> >> to import LZWInputStream, at least until the next release. Which is
> >> when?
> >>
> >
> > I think it is a good idea make [imaging] depend on [compress].
>
> Do you mean depend in general, or as opposed to the current use of the
> maven-shade-plugin to "half-depend" on it?
>

I mean plain and simple depend.

Gary


>
> Thank you
> Damjan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Damjan Jovanovic <da...@apache.org>.
On Thu, Oct 23, 2014 at 5:05 PM, Gary Gregory <ga...@gmail.com> wrote:
> On Thu, Oct 23, 2014 at 12:42 AM, Damjan Jovanovic <da...@apache.org>
> wrote:
>
>> Hi
>>
>> I've been hoping to steal commons-compress's cleaner and faster LZW
>> decompressor, and use it in commons-imaging for TIFF and GIF files,
>> and I've finally managed to make a patch to that effect.
>>
>> This requires moving LZWInputStream to a
>> org.apache.commons.compress.compressors.lzw package and making it
>> public. Any objections to this?
>>
>> Also imaging would have to depend on a SNAPSHOT of compress to be able
>> to import LZWInputStream, at least until the next release. Which is
>> when?
>>
>
> I think it is a good idea make [imaging] depend on [compress].

Do you mean depend in general, or as opposed to the current use of the
maven-shade-plugin to "half-depend" on it?

Thank you
Damjan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [compress][imaging] generalise/publicise commons-compress LZW implementation?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 23, 2014 at 12:42 AM, Damjan Jovanovic <da...@apache.org>
wrote:

> Hi
>
> I've been hoping to steal commons-compress's cleaner and faster LZW
> decompressor, and use it in commons-imaging for TIFF and GIF files,
> and I've finally managed to make a patch to that effect.
>
> This requires moving LZWInputStream to a
> org.apache.commons.compress.compressors.lzw package and making it
> public. Any objections to this?
>
> Also imaging would have to depend on a SNAPSHOT of compress to be able
> to import LZWInputStream, at least until the next release. Which is
> when?
>

I think it is a good idea make [imaging] depend on [compress].

Gary


> I am attaching patches in case anyone wants to have a look, but I can
> commit them myself if there are no objections.
>
> Thank you
> Damjan
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory