gsathya / htpt

HTTP Tor Pluggable Transport
Other
4 stars 3 forks source link

Using ImageMagick #9

Closed sdonovan1985 closed 7 years ago

sdonovan1985 commented 10 years ago

How to do lossless jpeg conversion! http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=15516

Choose a python binding: http://www.imagemagick.org/script/api.php

gsathya commented 10 years ago

Apparently this doesn't work as expected. @sdonovan1985 has more thoughts on this.

sdonovan1985 commented 10 years ago

This generally works, but the BMP header gets modified during the process. In my quick test, it totally changed the header and made it longer. The important thing is, inside the header the is a data offset at bytes 0x02 and 0x0a (why it's there twice, I don't know). We can go off that pretty easily though and anything after that is just fine. I'm happy to show anyone how I did the test.

sdonovan1985 commented 10 years ago

An example of how to do it:

convert -quality 100 -compress lossless test-input.bmp test-output-2.llj convert test-output-2.llj test-output-output2.bmp dhex -o1h 6C -o2h 7C test-input.bmp test-output-output2.bmp

karimhabak commented 10 years ago

I was doing exactly this :)

I detected the error just before coming and fixed it. That it why I came late :)

I mistakenly appended to one of the files instead of overwriting :)

Lossless jpeg is currently working perfectly :)

Sorry guys for this inconvenience.

On Tue, Nov 12, 2013 at 9:50 AM, Sean Donovan notifications@github.comwrote:

An example of how to do it:

convert -quality 100 -compress lossless test-input.bmp test-output-2.llj convert test-output-2.llj test-output-output2.bmp dhex -o1h 6C -o2h 7C test-input.bmp test-output-output2.bmp

— Reply to this email directly or view it on GitHubhttps://github.com/gsathya/htpt/issues/9#issuecomment-28298835 .

Regards, Karim Habak School of Computer Science http://www.scs.gatech.edu/ College of Computing http://www.cc.gatech.edu/ Georgia Inistitute of Technology http://www.gatech.edu/

email: karim.habak@cc.gatech.edu Tel: +1(404) 645-4232 Web: http://www.cc.gatech.edu/~khabak3/

sdonovan1985 commented 10 years ago

Excellent! Nice easy fixes are the best fixes.

On Tue, Nov 12, 2013 at 9:52 AM, Karim Habak notifications@github.comwrote:

I was doing exactly this :)

I detected the error just before coming and fixed it. That it why I came late :)

I mistakenly appended to one of the files instead of overwriting :)

Lossless jpeg is currently working perfectly :)

Sorry guys for this inconvenience.

On Tue, Nov 12, 2013 at 9:50 AM, Sean Donovan notifications@github.comwrote:

An example of how to do it:

convert -quality 100 -compress lossless test-input.bmp test-output-2.llj convert test-output-2.llj test-output-output2.bmp dhex -o1h 6C -o2h 7C test-input.bmp test-output-output2.bmp

— Reply to this email directly or view it on GitHub< https://github.com/gsathya/htpt/issues/9#issuecomment-28298835> .

Regards, Karim Habak School of Computer Science http://www.scs.gatech.edu/ College of Computing http://www.cc.gatech.edu/ Georgia Inistitute of Technology http://www.gatech.edu/

email: karim.habak@cc.gatech.edu Tel: +1(404) 645-4232 Web: http://www.cc.gatech.edu/~khabak3/

— Reply to this email directly or view it on GitHubhttps://github.com/gsathya/htpt/issues/9#issuecomment-28299079 .

sdonovan1985 commented 7 years ago

Closing, as this is stale.