Open rodrigodeppe opened 10 years ago
Hi, nice to hear - thanks for your contribution. I will merge it eventually. Oh, as I don't have AutoCAD: could you create a testfile so that I can include in the testsuite? It doesn't have to fancy, just so that I can see if it breaks.
Hi Benjamin,
I’ve updated the code on github since I noticed that the rescaling of 32bit bmp files was not working. Maybe you can take a look at this.
It seems like the AutoCad DWG file can have an 8, 24 or 32 bit bitmap embebed on it.
Attached are some samples. The visualization - aerial.dwg I have downloaded from the AutoCad website.
Rodrigo Deppe
De: Benjamin Pick [mailto:notifications@github.com] Enviada em: domingo, 10 de agosto de 2014 12:50 Para: benjaminpick/java-thumbnailer Cc: Rodrigo Deppe Assunto: Re: [java-thumbnailer] AutoCad DWG thumbnail (#9)
Hi, nice to hear - thanks for your contribution. I will merge it eventually. Oh, as I don't have AutoCAD: could you create a testfile so that I can include in the testsuite? It doesn't have to fancy, just so that I can see if it breaks.
— Reply to this email directly or view it on GitHub https://github.com/benjaminpick/java-thumbnailer/issues/9#issuecomment-51718553 .Imagem removida pelo remetente.
Hi Rodrigo,
so I've merged your thumbnailer and replaced the scaling code by my Util Class (so that the resulting image always has the specified size).
32bit, however, still doesn't work:
[junit] Caused by: java.io.EOFException [junit] at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:353) [junit] at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:405) [junit] at com.sun.imageio.plugins.bmp.BMPImageReader.read32Bit(BMPImageReader.java:1353) [junit] at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:890) [junit] at javax.imageio.ImageIO.read(ImageIO.java:1448) [junit] at javax.imageio.ImageIO.read(ImageIO.java:1352)
Note that Java recognizes it as 32bit, but cannot read enough bytes. My guess is that one of the magical numbers in the code above need to be updated, but as I don't know the spec of BMP I have to desire to start debugging :-)
Where is the code coming from, actually? Did you write it or get it from an GPL-licenced project?
Hey, Benjamin.
Funny. If you let the 32bmp get extracted to disk you will see that MS Paint and other programs are able to read it. Even explorer, on its thumbnail setting, can show it. I will take a look at the BMP specs to see if I missed anything. It sure looks like it wanted to read more.
About the code, I got it from the specs on the file attached (pages 22, 88 & 89). The BMP specs for creating the header I found in some pages over the internet.
I will let you know if I find out anything or not.
Thanks,
Rodrigo Deppe
De: Benjamin Pick [mailto:notifications@github.com] Enviada em: sábado, 16 de agosto de 2014 05:20 Para: benjaminpick/java-thumbnailer Cc: Rodrigo Deppe Assunto: Re: [java-thumbnailer] AutoCad DWG thumbnail (#9)
Hi Rodrigo,
so I've merged your thumbnailer and replaced the scaling code by my Util Class (so that the resulting image always has the specified size).
32bit, however, still doesn't work:
[junit] Caused by: java.io.EOFException [junit] at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:353) [junit] at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:405) [junit] at com.sun.imageio.plugins.bmp.BMPImageReader.read32Bit(BMPImageReader.java:1353) [junit] at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:890) [junit] at javax.imageio.ImageIO.read(ImageIO.java:1448) [junit] at javax.imageio.ImageIO.read(ImageIO.java:1352)
Note that Java recognizes it as 32bit, but cannot read enough bytes. My guess is that one of the magical numbers in the code above need to be updated, but as I don't know the spec of BMP I have to desire to start debugging :-)
Where is the code coming from, actually? Did you write it or get it from an GPL-licenced project?
— Reply to this email directly or view it on GitHub https://github.com/benjaminpick/java-thumbnailer/issues/9#issuecomment-52387298 . https://github.com/notifications/beacon/8402283__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMzc5NjQwOCwiZGF0YSI6eyJpZCI6MzkyNTkxMjh9fQ==--c8e889f6ee0662d1805ccbdde884abf4f9bc947b.gif
Hello, I've been using this lib for quite a while now. Congratulations on the good job done.
Recently I had to generate thumbs from AutoCad DWG files. I found out that a BMP preview is stored within the file and created a DWGThumbnailer that can be registered on your lib. Thought you would like to have a copy. Of course if you find any room for improvement on the code, feel free to do it. Best regards, Rodrigo Deppe
Here is the code:
public class DWGThumbnailer extends DummyThumbnailer {
}