Rendering Images inside PDF, images not being rendered in PDF Viewer 0.1.8 - itext

Please check updates as they have additional informations... Apparently located the problem in a specific pdf client but cannot close the issue with an open bounty...
I am generating a pdf using grails rendering plugin. The PDF has a couple of images inside and "some" of them are not being outputted!
I am rendering the images inline via data uris as required by the plugin. That means that all my images are something like:
<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQECWAJYAAD...">
If I render them in a normal html view, I can see the images just fine!
If I render the template to a JPG/PNG with the same plugin, again the images render all fine.
If I render to PDF the images which are being retrieved by an octed-stream are broken!
Something like:
Looks like the image started to render and then something happened...
It is happening on the big-sized images, but also on the thumbnail version of same image.
Any one has some hints as why this might occur?
UPDATE
The file which does not show up is a file with mime application/octet-stream
So apparently I can retrieve the bytes from the file, but when they transmitted for PDF Rendering, the image does not appear...
Yet another update
The issue seems to be related with the PDF Viewer. Was using a Linux based PDF Viewer (PDF Viewer 0.1.8) and specific images are broken. In all other PDF Viewers I could test everything works fine.
Cannot close the issue as there is a bounty open :( Sorry that the bounty and question seems meaningless now, but you never know, someone might have an idea how to solve this even for PDF Viewer 0.1.8.

<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQECWAJYAAD...">
works fine for me. Note the missing "e".

You can use rendering tag:
<rendering:inlineJpeg bytes="${your-image}" />
Make sure you decodeBase64() your image.

Related

tinyMCE - is it possible to prevent the cut and paste of images (base64) in the textbox?

TinyMCE 4: I have implemented the image file/upload from local source, using php to save the uploaded file into a directory, with tinyMCE referencing this image. Works fine. This leaves a simple html text file to save in the database.
However, I see that the user can just cut and paste an image directly into the textbox, resulting in the image showing up and becoming a base64 image string, which defeats the purpose of storing only html text. Now the text could become extremely long if this base64 image is not prevented.
Is there a way to prevent this image paste action in tinyMCE? Or better yet, a way to automatically convert this paste into an image file and have it stored in the same place as the other images on the fly?
I know I could convert base64 images to a jpg files and store after submitting the form to a php handler, but would seek a simpler answer if possible.
The documentation is your friend for this issue. TinyMCE can certainly help you convert the images on the fly as they are pasted into the editor:
https://www.tinymce.com/docs/advanced/handle-async-image-uploads/
You can also stop the images from appearing in the first place if that is your preference:
https://www.tinymce.com/docs/plugins/paste/#paste_data_images

jQuery-File-Upload: Image preview not being generated for all images

For most images jQuery-File-Upload is displaying a preview image. However, for some large images (14MB) no preview is being displayed. Why is this happening and is there anyway to fix this? Unfortunately I am not seeing any errors on my web dev console when this happens so I have no idea how to debug this issue.
Here is a link to an example image that will not display a preview for me.
This helps me in same situation:
in file
jquery.fileupload-image.js
change parameter
loadImageMaxFileSize: 40000000 /40MB

Typo3 GraphicMagick Thumbs transparent

Im working on a website using typo3 and the image handler being used is GraphicMagick. At an certain page im displaying an Latest view news item.
This news item contains an media pdf file.
So when I visit that page I will see an Thumb of that pdf since that is being created by GraphicMagick and stored in my typo3temp folder.
Now the real question is.. that this gif file, is like 10-15% transparent at the top.
I have no idea how this comes.. the settings in the installation tool look similar to the onces I use on a different website.
Did anybody see this before and knows how I might resolve this ?
I'm using the following versions:
Typo3: 6.2.11
imagehandler: Graphics Magick
[GFX][thumbnails_png] = 1
Solved it for me, gifs gave me a problem

Why does one of my pngs have a query string attached?

I'm not using any WP cache plug ins. I've noticed that only one png out of the other pngs (and other images) I have on my WP site has a query string attached to it when I look at in Chrome dev tools. It's actually downloaded twice - with and without query string.
The other odd this is that Chrome Dev tools says that the intiator for the png with query string is jQuery. I just include jQuery from Google's CDN, so I'm not changing anything.
Any ideas to why just one of my pngs (why this one?) has a query string attached? Here's what it looks like:
<img src="http://www.mysite.com/wp-content/themes/myTheme/images/slide1Btn.png?1369071380764" alt="">
Please let me know if I haven't included enough information.
Edit
This png is a button on one of the slides I have in a slideshow. I use http://archive.slidesjs.com/ to generate the slideshow. The png images are part of the HTML markup and not generated by the script, however I did find this line in the slides.js code:
// gets image src, with cache buster
var img = control.find('img:eq(' + start + ')').attr('src') + '?' + (new Date()).getTime();
I would like to just have the png load once and just be retrieved from the cache on reloads - like each of the pngs will do on subsequent slides in my slideshow. I'm perplexed as to why it only happens to this png.
It might either be :
some argument for a script that dynamically generates or resizes or processes the image (it does not matter that the url has a .png extension, that doesn't necessarily mean that a png file is served statically)
a "cache breaker" - or "cache buster". This can be used to prevent the browser (sometimes also the server) to get the image from a cache, and force it to get it fresh from the server.
Because in this case this looks as a timestamp (unix epoch in milliseconds), I'd bet for the later.
wordpress generates many of the images dynamically, meaning when you access the png you are calling a server page that generates the png dynamically choosing between different images or based on the query string parameters, like size for exmaple.
200px width image.
http://mysite.com/wp-content/uploads/2013/05/Giant_water_bugs_on_plate.png&w=200&h=446&zc=1&q=100
vs
600px width image
http://mysite.com/wp-content/uploads/2013/05/Giant_water_bugs_on_plate.png&w=800&h=446&zc=1&q=100

Using HTML pages in UIWebView, strange issues with relative page images but links work

So I'm creating an app which basically is a UIWebView that loads an HTML page, which should have images on it. The HTML page is loading fine (confirmed with a little text on the page), but then I have this code in it:
<img src="images/image_1.png">
test
Check this out:
The tag has a broken image link
But, when I tap on the link, the
image loads!
How is this happening? What kind of solution is there?
I have the images in a subfolder of resources, which I added by "Create Folder References."
Help? A note: This is on iPad, using 4.2. But that shouldn't matter, right Apple? (Also, changing it to xml <img /> type tag doesn't do anything)
The image was way too big - over 2500px wide. Resizing to 1024px fixed it. Thanks Jose Vega.
Also, Automator is a gift from the Gods when it comes to batch operations.