Discussion:
[Rabbit-dev] JPEG
Rick Leir
2009-10-27 13:52:55 UTC
Permalink
Hi Robo and all,
Maybe I am missing something, but is it not easier to compress a JPEG
using Java 2D libraries? Something like:
// encodes bi as a JPEG data stream
ByteArrayOutputStream out = new ByteArrayOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
param.setQuality(1.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(bi);
From
http://java.sun.com/products/java-media/2D/samples/suite/Image/JPEGFlip.java

Maybe you looked into this already.
Thanks,
Rick
--
Rick Leir rick (at)leirtech (.) com
613 828 8289 O
613 878 7870 C
http://blinkmonitor.com/
Robert Olofsson
2009-10-27 17:54:42 UTC
Permalink
On Tue, 27 Oct 2009 09:52:55 -0400
Post by Rick Leir
Maybe I am missing something, but is it not easier to compress a JPEG
That is indeed simple, but there are a few reasons why rabbit does not use it.

1) When rabbit came into existence there were no such classes
2) The JPEGImageEncoder used to be very slow (probably better now)
3) The JPEGImageEncoder used to be unstable (= jvm crash)
4) Resource usage of the proxy can grow very much if there are many
concurrent image conversions.

But you are right to query this and I actually do think that it is
time to revisit the issue.

Writing a java class that runs at most X concurrent conversions is not
that hard and could very well be a good alternative for forking a convert
process.

/robo
Samat K Jain
2009-10-27 18:43:06 UTC
Permalink
Post by Robert Olofsson
That is indeed simple, but there are a few reasons why rabbit does not use it.
1) When rabbit came into existence there were no such classes
2) The JPEGImageEncoder used to be very slow (probably better now)
3) The JPEGImageEncoder used to be unstable (= jvm crash)
4) Resource usage of the proxy can grow very much if there are many
concurrent image conversions.
But you are right to query this and I actually do think that it is
time to revisit the issue.
Writing a java class that runs at most X concurrent conversions is not
that hard and could very well be a good alternative for forking a convert
process.
Could this explanation be added as a FAQ item?
--
Samat K Jain <http://samat.org/> | GPG: 0x0x4A456FBA

Boys are great. Every girl should own one.
-- None (668)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: <http://khelekore.org/pipermail/rabbit-dev/attachments/20091027/1570ddd1/attachment.pgp>
Samat K Jain
2009-10-27 18:43:06 UTC
Permalink
Post by Robert Olofsson
That is indeed simple, but there are a few reasons why rabbit does not use it.
1) When rabbit came into existence there were no such classes
2) The JPEGImageEncoder used to be very slow (probably better now)
3) The JPEGImageEncoder used to be unstable (= jvm crash)
4) Resource usage of the proxy can grow very much if there are many
concurrent image conversions.
But you are right to query this and I actually do think that it is
time to revisit the issue.
Writing a java class that runs at most X concurrent conversions is not
that hard and could very well be a good alternative for forking a convert
process.
Could this explanation be added as a FAQ item?
--
Samat K Jain <http://samat.org/> | GPG: 0x0x4A456FBA

Boys are great. Every girl should own one.
-- None (668)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: <http://khelekore.org/pipermail/rabbit-dev/attachments/20091027/1570ddd1/attachment-0002.pgp>
Samat K Jain
2009-10-27 18:43:06 UTC
Permalink
Post by Robert Olofsson
That is indeed simple, but there are a few reasons why rabbit does not use it.
1) When rabbit came into existence there were no such classes
2) The JPEGImageEncoder used to be very slow (probably better now)
3) The JPEGImageEncoder used to be unstable (= jvm crash)
4) Resource usage of the proxy can grow very much if there are many
concurrent image conversions.
But you are right to query this and I actually do think that it is
time to revisit the issue.
Writing a java class that runs at most X concurrent conversions is not
that hard and could very well be a good alternative for forking a convert
process.
Could this explanation be added as a FAQ item?
--
Samat K Jain <http://samat.org/> | GPG: 0x0x4A456FBA

Boys are great. Every girl should own one.
-- None (668)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL: <http://khelekore.org/pipermail/rabbit-dev/attachments/20091027/1570ddd1/attachment-0003.pgp>
Rick Leir
2009-10-27 13:52:55 UTC
Permalink
Hi Robo and all,
Maybe I am missing something, but is it not easier to compress a JPEG
using Java 2D libraries? Something like:
// encodes bi as a JPEG data stream
ByteArrayOutputStream out = new ByteArrayOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
param.setQuality(1.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(bi);
From
http://java.sun.com/products/java-media/2D/samples/suite/Image/JPEGFlip.java

Maybe you looked into this already.
Thanks,
Rick
--
Rick Leir rick (at)leirtech (.) com
613 828 8289 O
613 878 7870 C
http://blinkmonitor.com/
Robert Olofsson
2009-10-27 17:54:42 UTC
Permalink
On Tue, 27 Oct 2009 09:52:55 -0400
Post by Rick Leir
Maybe I am missing something, but is it not easier to compress a JPEG
That is indeed simple, but there are a few reasons why rabbit does not use it.

1) When rabbit came into existence there were no such classes
2) The JPEGImageEncoder used to be very slow (probably better now)
3) The JPEGImageEncoder used to be unstable (= jvm crash)
4) Resource usage of the proxy can grow very much if there are many
concurrent image conversions.

But you are right to query this and I actually do think that it is
time to revisit the issue.

Writing a java class that runs at most X concurrent conversions is not
that hard and could very well be a good alternative for forking a convert
process.

/robo
Rick Leir
2009-10-27 13:52:55 UTC
Permalink
Hi Robo and all,
Maybe I am missing something, but is it not easier to compress a JPEG
using Java 2D libraries? Something like:
// encodes bi as a JPEG data stream
ByteArrayOutputStream out = new ByteArrayOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(bi);
param.setQuality(1.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(bi);
From
http://java.sun.com/products/java-media/2D/samples/suite/Image/JPEGFlip.java

Maybe you looked into this already.
Thanks,
Rick
--
Rick Leir rick (at)leirtech (.) com
613 828 8289 O
613 878 7870 C
http://blinkmonitor.com/
Robert Olofsson
2009-10-27 17:54:42 UTC
Permalink
On Tue, 27 Oct 2009 09:52:55 -0400
Post by Rick Leir
Maybe I am missing something, but is it not easier to compress a JPEG
That is indeed simple, but there are a few reasons why rabbit does not use it.

1) When rabbit came into existence there were no such classes
2) The JPEGImageEncoder used to be very slow (probably better now)
3) The JPEGImageEncoder used to be unstable (= jvm crash)
4) Resource usage of the proxy can grow very much if there are many
concurrent image conversions.

But you are right to query this and I actually do think that it is
time to revisit the issue.

Writing a java class that runs at most X concurrent conversions is not
that hard and could very well be a good alternative for forking a convert
process.

/robo
Loading...