Holder JS will not work with % - holder.js

I am using the latest version of holder.js from here
How ever if I try to use percentage for the width like
<img data-src="holder.js/100%x380" class="img-responsive">
Does not work. In older version it did but not in current versions
Question How can I make holder.js use % for width in latest versions?

I have found how to get full width with latest version of holder js
Instead of % use px like
100 for full width and then you can have any height your after.
<img data-src="holder.js/100px380" class="img-responsive">
Link

Related

How to get cropped image dimensions in a Fluid template in Typo3 v8

Is there a way to get the actual image size (width/height) of a cropped image ("Image manipulation" > [Open Editor]) in a fluid template?
All I can come up with is {image.properties} and width and height. But these are the dimensions of the original resource, not the cropped one. And there is of course an attribute crop which holds all the crop info:
{"default":{"cropArea":{"height":0.6431784107946027,"width":0.608,"x":0.037,"y":0.15592203898050974},"selectedRatio":"NaN","focusArea":null}}
But do I really have to find a way to parse this in fluid (if that's even possible)? Isn't there an official way to calculate the actual dimension of a generated image?
My use case is an image gallery component for which I need to explicitly state the image dimensions.
In TYPO3 Fluid, You can crop image like below. See here
<f:image src="{image ogject}" alt="Landscape" width="100c" height="100c" />
You could use the VHS Media / SizeViewHelper https://fluidtypo3.org/viewhelpers/vhs/master/Media/SizeViewHelper.html
<f:format.bytes><v:media.size path="{f:uri.image(image: mediaElement, width: 600) -> v:format.trim(characters: '/')}" /></f:format.bytes>

TYPO3 image crop disable this function

TYPO3 crops the media files which were added as text & media. How can I disable this? I want that it uses the original file.
It always takes this:
fileadmin/_processed_/c/a/csm_herren2_b3373d24a3.png
Change the fluid template and remove the width and height attributes of the
Or maybe easier change the typoscript constant that define the max size to a higher value styles.content.textmedia.maxW = 600 and styles.content.textmedia.maxWInText = 300.

Display vertical axis individual chart labels in google column chart

I am using google column chart for a while and I want to display the vertical columns value at top of each column. I am able to get the tool tip value but my requirement is not concerned with the tooltip.
Is there any way to display column values at top of each column so that it is easier to visualize? I looked at the options but couldn't get to make this work.
Here is the link for column chart that I am using
https://developers.google.com/chart/interactive/docs/gallery/columnchart
This feature is highly sought after, but unfortunately still not supported by Google Charts.
After long striving with this, I've made a hack to the ComboChart (could work with BarChart and ColumnChart as well, with a couple of changes) to insert the labels into the SVG.
Check out this fiddle: http://jsfiddle.net/augustomen/FE2nh/
Tested on Firefox 21, Chrome 27 and IE 9.

FastPDFKit get document size

I might be overlooking this, but how can one get the size of a PDF if you're using FastPDFKit?
I'm trying to create PNG's from a pdf, but without knowing the actual dimensions of the page it's rather hard to get it right.
EDIT:
I searching in the documentation before, but all I found was this method:
- (void)getCropbox:(CGRect *)cropbox andRotation:(int *)rotation forPageNumber:(NSInteger)pageNumber withBuffer:(BOOL)withOrWithout
But I have no idea how to use it, it doesn't return anything.
Not sure how familiar you are with PDF, but each page specifies a number of "boxes" that are various rectangles of interest (crop, media, etc)
Most apps using PDF elect to use the crop box which defines the region of the page that should be displayed. (See section 10.10.1 of the PDF 1.7 specification: http://www.adobe.com/devnet/pdf/pdf_reference_archive.html)
Also of note is that a page can specify a rotation angle of 0, 90, 180, or 270 which you need to apply to the crop box yourself. (see /Rotate in table TABLE 3.27 of the PDF 1.7 spec)
So using the above API you would call it like so:
[somePDFDoc getCropbox:&cropbox andRotation:&rotation forPageNumber:10 withBuffer:NO];
This would give you the cropbox rect and it's rotation.
NOTE: I have never used FastPDFKit
NOTE2: If the value of cropbox is CGRectZero, you want to use one of the other rects. Most viewers use the media box instead.

Remove padding in google chart?

I'm wondering why google charts add a blank padding when not specifying the top/right/left axises.
Select the image and you'll find a huge padding except the bottom which is already filled & that's why, how to remove that?
Specifically, Talking about the right and left paddings.
Thank you.
You can use the chartArea option as follows:
options.chartArea = { left: '8%', top: '8%', width: "70%", height: "70%"};
More documentation can be viewed here:
https://developers.google.com/chart/interactive/docs/gallery/piechart#Configuration_Options
When using the Google Chart API you can eliminate the padding. I made an example Here.
The relevant parameter is chma.
According to the documentation:
You can specify the size of the chart's margins, in pixels. Margins are calculated inward from the specified chart size (chs); increasing the margin size does not increase the total chart size, but rather shrinks the chart area, if necessary.
You can try these parameters online in the Chart Playground HERE.
HTH!
Edit: Warning from Google
Important: The Image Charts portion of Google Chart Tools has been officially deprecated as of April 20, 2012. It will continue to work as per our deprecation policy.
Unfortunately, as said in Chart Margins documentation you can set only the minimum margin on each side of the chart.
Google adds some unnecessary margin (mostly on top) itself and there is no parameter which can stop this behavior.