FOP with IKVM: No Images - image

I've successfully compiled and used FOP 1.0 with IKVM 0.44.5 in .NET, however I can't get it to show any images in the resulting PDF.
When I run FOP via ikvm in the command-line, I get a java.io.EOFException. When I transform the same file using java, the Images shows up perfectly.
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.readUTF(Unknown Source)
at java.lang.reflect.Method.invoke(Method.java:612)
at org.apache.xmlgraphics.image.loader.util.ImageUtil$1.invoke(ImageUtil.java:246)
at $Proxy0.readUTF(Unknown Source)
at com.sun.imageio.plugins.png.PNGImageReader.parse_iTXt_chunk(PNGImageReader.java:469)
at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:710)
at com.sun.imageio.plugins.png.PNGImageReader.getImageMetadata(PNGImageReader.java:1543)
at org.apache.xmlgraphics.image.loader.impl.imageio.PreloaderImageIO.preloadImage(PreloaderImageIO.java:71)
at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:176)
at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:128)
at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:122)
at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81)
Caused by: java.io.EOFException
at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:346)
at java.io.DataInputStream.readUTF(DataInputStream.java:607)
at javax.imageio.stream.ImageInputStreamImpl.readUTF(ImageInputStreamImpl.java:332)
... 49 more
Has anyone gotten images to work using FOP+IKVM? Any help or pointers to a solution would be highly appreciated!

I don't know much about FOP, but a simple example with images works:
C:\j\fop-1.0>set JAVACMD=\ikvm-0.44.0.5\bin\ikvm.exe
C:\j\fop-1.0>fop -fo examples\fo\basic\images.fo -pdf images.pdf
This results in an images.pdf that looks good.
If you have a repro scenario for this, feel free to mail it to me (jeroen#frijters.net) and I'll have a look.
Update: Thanks for the .png that caused the problem. I reproduced the problem with 0.44, but in the current development version it works correctly. The most recent development snapshot is available at http://weblog.ikvm.net/

Related

i cannot run any gradle projects

this is the minecraft forges default gradle
i also search but didnt find any answers
C:\Users\masiha.DESKTOP-VBVOMDJ\.gradle\wrapper\dists\gradle-4.10.3-bin\31t79e2qsceia4mkbojplrgx
Exception in thread "main" java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at org.gradle.wrapper.Install.unzip(Install.java:215)
at org.gradle.wrapper.Install.access$600(Install.java:27)
at org.gradle.wrapper.Install$1.call(Install.java:75)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
pleas help :)
This problem accrued to me yesterday as well, so I thought I might share my fix to this problem if this is still relevant.
While I am not familiar with Forge at all (I started using Fabric just a few days ago), how I fixed my problem was to change the settings in either the gradle.properties or build.gradle according to your mod's correct settings.
Most likely your problem occurs in gradle.properties. It might be the version number that isn't correct, and a quick research of the current Forge or Minecraft version you're planning on using would help. The same applies to build.gradle.
In the crash log you've provided, most of the errors are coming from the class org.gradle.wrapper.*, so it's likely to assume that it is something in one of the 2 files.
If neither of that worked, it might be because you've entered an incorrect path to your main class in the forge.mod.json file.
For example, if your classpath is hi.mashia.main, then you'll have to enter it in the 'main' field there as well. This could've happen if you've changed your classpath or name lately, or just installed a new Forge environment and didn't set this thing up.
Again, I'm not using Forge, and I'm just telling my own experience with things.
So if this doesn't help, just try to look for common Gradle errors in the Gradle User Manual, or if this doesn't help, then you might want to look into the Forge Docs or something similar to that. Google search or YouTube might help with that too.
A video that I think you could potentially find helpful is this one by TechnoVision.
It might be outdated, but not too outdated.
Really hope this helps!
Happy Coding!

How do I interact with Apache Jena locally? - MacOS

I may just be going at this wrong, but I am not sure how to interact with Apache Jena on my computer. I think my main question revolves around where I store files and how I run them.
I use Atom editor and work in Python and Javascript normally. My goal here is to get a handle of how Jena and Fuseki work then potentially using Fuseki for the backend of a web app.
The tutorial, An Introduction to RDF and the Jena RDF API, links to Java files. Where do I store this file on my desktop and how can I run it?
While my question is about setting up my workspace/environment, I would appreciate feedback on more appropriate technologies.
Based on this tutorial I've gotten my workspace set up. I've removed the package identifier from my code.
Now I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/jena/rdf/model/ModelFactory at
Tutorial01.main(Tutorial01.java:34)
Caused by: java.lang.ClassNotFoundException:
org.apache.jena.rdf.model.ModelFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
I think it's a JENAROOT Issue. I think I'm setting it and adding it to the path correctly. It's also mentioned here, but I haven't been able to troubleshoot it yet.
Anybody can point me in the right direction?
I got help of this via the Apache Jena support email. I think I must have caused an issue by changing the environmental variables for Jena upon first use.
Based on a script I received from a community member I ran a script named jenaJarsScript.sh in terminal:
unset JARS
for f in $JENA_HOME/lib/*.jar
do
JARS=$JARS:$f
export JARS
done
I then added $JARS to my classpath - now I can compile and run code without an issue.
Note: I'm not sure if this is the best way to set this up, but it works for me.

Three.js Typeface.js offline

the problem is obvious from the title, http://typeface.neocracy.org offline. It was used to convert fonts and used in conjunction with THREE.TextGeometry. But if it is offline, how is now possible to use custom fonts in three.js?
I made a new converter that outputs the same files as typeface.js.
http://gero3.github.io/facetype.js/
I loaded the source, but as far as I can see there is no chance to create the JS-font-files with this distribution. Maybe for someone with deep perl-knowledge...? In any case I installed perl, the ppm and dmake but trying to exec the Makefile only leads to errormessages about missing files. No - this is no alternative to the online-converter. Even worser: I didn't find any other converter or another side using the same one (cufon seems to create another format). So let's hope the site comes back to live - otherwise the great textfeature of three.js is worth nothing in the moment.

Workaround for ImageIO.read bug in OpenJDK 8?

I'm using Java 8 (OpenJDK 8, specifically) for a project and I need to read an image from a JPG file. Searching around got me to some similar questions at first (e.g. Read byte array into buffered image WITHOUT ImageIO and Is there a 100% Java alternative to ImageIO for reading JPEG files?), but my problem is different and the solutions there do not meet my requirements.
It turns out that the JPEGImageReader class is still missing. (See openjdk-8: Missing JPEGImageReader functions in libjavajpeg.so) Although that bug report is for Debian, I'm using Kubuntu 14.10 and it's also affected.
Based on the report's last message, no one seems to be working on this issue at this time...
The code snippet to reproduce this error is:
// ...
BufferedImage img = null;
try {
img = ImageIO.read(new File(filename));
} catch (IOException e) {
throw new RuntimeException(e);
}
// ...
The path to the file is valid and this works normally if I use Java 1.7, but changing to 1.8 causes the following excpetion on ImageIO.read call:
Caught UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initReaderIDs(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;)
I'd like help working around this problem while avoiding:
additional dependencies on other/external libraries;
going back to Java 1.7;
having to rebuild from source;
Oracle's proprietary implementation of the JDK
Working code snippets appreciated.
EDIT-1: Added point #4 to the list.
EDIT-2: Reworded a portion of the main section and added another reference.
I believe this has now been fixed as of March 17th, 2015 release, as per Matthias Klose's email:
Source: openjdk-8 Source-Version: 8u40-b27-1
We believe that the bug you reported is fixed in the latest version of
openjdk-8, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 760926#bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software pp. Matthias Klose
(supplier of updated openjdk-8 package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster#ftp-master.debian.org)
Is using the Oracle JDK a possibility?
If so, there is some info here on a ppa you can use with ubuntu.
You could install the java advanced imaging libraries which also provides a jpeg (and other codec) implementation.
I believe the problem here is with the fact that the generated image is in JPEG format.Once i got it generated it in PNG format,the issue got resolved. I used Grabzit API to capture screenshot and get it saved in PNG format

compressed / minified prototype file

I need a compressed minified prototype file.
Can anyone help me?
Thanks
As far as I'm aware, there's no official or hosted minified build of Prototype. You can run it through jsmin easily enough, but then you have to host it yourself. Or as Tomasz pointed out, you can use the unminified (but gzipped) version from Google's CDN.
Google does not hurt: http://prototypejs.org/2008/05/27/prototype-hosted-on-google-s-servers
(corrected link)
FWIW, I ran prototype.js (v. 1.6) through UglifyJS using http://jscompress.com/, and started getting a bunch of javascript errors. So Google is clearly the way to go.
I found the solution and minimized this file, it went from 130mb to 67 mb. Although I did very minimal testing, everything works on my end with no firebug errors. Please Let me know how it works on your scripts.
Heres the link!
You have to upload the entire file on the right hand side.
http://shrinksafe.dojotoolkit.org/

Resources