jai

JAI ImageIO NoClassDefFoundError for RawImageInputStream

ぐ巨炮叔叔 提交于 2021-02-07 08:55:04
问题 I am very confused with this issue. I am using 1.3.0 version on jai-imageio-core please check the dependecy below and I am at complete loss to figure out from the jar how can one class file (RawImageReaderSpi) is loaded in JVM but RawImageInputStream is not loaded. I have deployed my spring boot web service in tomcat 7 container. This issue pops up randomly and I have noticed that when I have restarted the TC container and deployed new version of my service, this issue shows up intermittently

How can I write 16 bit grayscale image as jpeg?

回眸只為那壹抹淺笑 提交于 2021-01-27 11:52:27
问题 I have 16-bit per pixel grayscale BufferedImage created from an array of shorts: private BufferedImage get16bitImage(short[] pixels) { ColorModel colorModel = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_GRAY), new int[]{16}, false, false, Transparency.OPAQUE, DataBuffer.TYPE_USHORT); DataBufferUShort db = new DataBufferUShort(pixels, pixels.length); WritableRaster raster = Raster.createInterleavedRaster( db, imgD.width, imgD.height, imgD.width, 1, new int[1], null); return

Loading JPEG2000 Images using JAI

微笑、不失礼 提交于 2020-08-10 22:12:53
问题 I want to load a jpeg2000 image (.jp2) using Java JAI. I'm already using an older JAI version which still supports the jpeg2000. I downloaded these images from scihub.copernicus.eu. These files are rather big (up to 100 MB). I tried several different approaches: With java the standard way works like that: public class Main { public static void main(String[] args) throws IOException { String path = "C:\\temp\\B2.jp2"; File inputFile = new File(path); Image result = ImageIO.read(inputFile); } }

用户行为研究(八):争议性广告及其转化效果

拈花ヽ惹草 提交于 2020-07-24 15:31:56
Jari Jones代言Calvin Klein的事件引发了广泛的讨论和大量的批评。本次代言从形式上看,仅仅是广告投放的开始,而真正的广告投放在于其所引发的广泛讨论(以及批判)。大众越多参与到相关的讨论、批评和相互批评中,本次代言就越成功。这正是品牌方和广告策划着希望看到的。 从 计算广告学 的角度看,这一代言行为包括两个典型的子问题: 品牌与代言者的一致性问题 ( Celebrity-Brand Congruence ) 用户对争议性广告(包括争议性明星代言)的态度以及消费转化效果( Controversial Advertising ) 可惜目前的回答中都没有涉及这些广告学的现象,而是把品牌作为一个 普通感性人 来讨论,这显然不大可能符合实际——品牌方找代言人并投放广告所涉及的调研显然地会考虑其可能的后果,如果没有经历过品牌方认为的足够的研究论证,品牌方不可能花这个钱。 这里对应地分两个部分来简单讨论: >品牌与代言者的一致效应 (Celebrity-Brand Congruence) 所谓品牌与代言者的一致,也就是品牌形象和代言者的形象的一致:一个化妆品品牌(比如巴黎欧莱雅)可以找美女明星代言,这是一致,但一个技术服务商(比如阿里云)找美女明星代言,这就是不一致。 品牌代言者通过代言过程所表达的概念和内容直接影响传播对象用户,通过代言者的形象间接的影响用户对品牌的感知 [1]

How to save lossless jpg in java?

老子叫甜甜 提交于 2020-05-02 05:30:14
问题 I have to save a jpeg image lossless. I am work on a steganography project but Java compressing and saving my result. I research every forums and try everything but it didn't work. Here my example code for lossless save a jpeg image: BufferedImage image = ImageIO.read(new File("sources/image.jpg")); ImageWriter writer = ImageIO.getImageWritersByFormatName("JPEG").next(); JPEGImageWriteParam jpegParams = new JPEGImageWriteParam(null); jpegParams.setCompressionMode(ImageWriteParam.MODE_EXPLICIT

Not able to load javax.imageio.ImageIO class in WAS 8.5

有些话、适合烂在心里 提交于 2020-01-24 21:48:26
问题 I am not able to load ImageIO class of JAI 1.3.0. Java 6 and Web Application Server (WAS) 8.5. My code is working fine for Java 6 and WAS(7.0.19). I have mentioned dependency properly in pom. Need to know if any one has same issue or not. byte[] imgBytes = imagesVO.getImgBytes(); BufferedImage image = ImageIO.read(new ByteArrayInputStream(imgBytes)); It seems my server is not able load ImageIO class during execution, hence image value is coming null. I am passing Tiff format file in imagesVO

Converting PNG into JPEG

元气小坏坏 提交于 2020-01-19 07:38:48
问题 I'm having problems converting a simple PNG into a JPEG format. I'm using the following code: ... File png = new File(filePath); try { SeekableStream s = new FileSeekableStream(png); PNGDecodeParam pngParams = new PNGDecodeParam(); ImageDecoder dec = ImageCodec.createImageDecoder("png", s, pngParams); RenderedImage pngImage = dec.decodeAsRenderedImage(); JPEGEncodeParam jparam = new JPEGEncodeParam(); jparam.setQuality(0.50f); // e.g. 0.25f File jpeg = new File("jpeg.jpeg"); FileOutputStream

Converting PNG into JPEG

耗尽温柔 提交于 2020-01-19 07:36:29
问题 I'm having problems converting a simple PNG into a JPEG format. I'm using the following code: ... File png = new File(filePath); try { SeekableStream s = new FileSeekableStream(png); PNGDecodeParam pngParams = new PNGDecodeParam(); ImageDecoder dec = ImageCodec.createImageDecoder("png", s, pngParams); RenderedImage pngImage = dec.decodeAsRenderedImage(); JPEGEncodeParam jparam = new JPEGEncodeParam(); jparam.setQuality(0.50f); // e.g. 0.25f File jpeg = new File("jpeg.jpeg"); FileOutputStream