typo3 rtehtml upscaling images - typo3

I am trying to upscaling an image which is inserted into the rte in Typo3 with the image button.
If I change the width to a lower one, it is working fine. Height is choosen automatically. But if I try to increase the width, the rte only save this changes if I manually add the right height.
In my PageTS I already have this:
RTE.default.buttons.image.options {
magic.maxWidth = 1000
magic.maxHeight = 1000
plain.maxWidth = 1000
plain.maxHeight = 1000
}
I configured
TYPO3_CONF_VARS[GFX][im_noScaleUp] = 0
Has anyone an idea if this is a bug? How can I make typo3 to upscale the image?

Related

Unity Resizing Dropdown Dynamically

I have a dropdown list on a filter panel which needs to stretch dynamically to fit the content as shown:
I have tried several content size fitters but cannot find anything, If possible I would like to set a max width it can expand to then truncate everything longer than that, I would also like it to expand only to the right with a right pivot point. I have found a similar example here: https://forum.unity3d.com/threads/resize-standard-dropdown-to-fit-content-width.400502/
Thanks!
Well. Lets start with the code from that Unity forum thread.
var widest = 0f;
foreach (var item in _inputMines.GetComponentsInChildren<Text>()) {
widest = Mathf.Max(item.preferredWidth, widest);
}
_inputMines.GetComponent<LayoutElement>().preferredWidth = widest + 40;
We want to have a max-width allowed, so any content longer than this will be truncated. So let's add that variable:
var maxWidth = 250f;
//or whatever value; you may wish this to be a property so you can edit it in the inspector
var widest = 0f;
foreach (var item in _inputMines.GetComponentsInChildren<Text>()) {
Now we use the smaller of the two width values. Then apply it to the content layout:
}
widest = Mathf.Min(maxWidth, widest);
_inputMines.GetComponent<LayoutElement>().preferredWidth = widest + 40;
The +40 should be retained because that deals with the scrollbar. Your maxWidth value should be chosen to account for this.
Finally we want the longer items to get cut off nicely.
Give each dropdown item a Rect Mask 2D component (Component -> UI -> Rect Mask 2D). The template object exists in the scene hierarchy before the game is run, just disabled. You can just add the component to the parent transform, the one with the image (so the text is clipped).
You'll need to make sure that the mask covers the same width as the image graphic and expands along with it, possibly slightly shorter on the X direction so the text gets cut off before the image border is drawn. This should happen automatically, but you will need to check and possibly make some alterations to the template object. Alternatively you can use an Image Mask, but you'll have to play with that one yourself, but it will allow for non-rectangular clipping.
That's it!

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.

Showing image on a acro text field position

I had a PDF document which has acro text fields which is already shared to the client. Now the client wants to insert signature image in one of the text fields. My manager asked me to try a way to do the same.My idea is to replace an image on top of the text field position and resize the text field as image size.
For replacing acro text field of pdf into image, i am trying as below
1.Finding the text field by its field id
String position = null;
List<FieldPosition> fieldPositons = form.getFieldPositions("50106");
for (FieldPosition position :fieldPositons) {
this.position = position.position;
}
2. Setting the image into that position of text field
Image image = Image.getInstance("ImageFileName");
Float dimensions = position.split("x");
image.setAbsolutePosition(dimensions[0], dimensions[1]);
content.addImage(image);
Based on the given image width and height i need to change the width and height of acro text field.
Can any one tried as below, Is my logic works with itext pdf library. Let me know if any idea to replace acro text field with image
It is never a good idea to change the dimensions of an AcroField as all the content in a PDF is added at absolute positions. When you change the dimension of a field, you risk that it will overlap with other content.
Hence, your best option is to adapt the size of the image to the size of the AcroField. As you already indicated, you can get the field position like this:
AcroFields.FieldPosition f = form.GetFieldPositions("50106")[0];
Note that it's not a good idea to make this a string. You can use the FieldPosition object like this:
int page = f.page;
Rectangle rect = f.position;
You can scale and position the image like this:
Image image = Image.getInstance("ImageFileName");
image.ScaleToFit(rect.Width, rect.Height);
image.SetAbsolutePosition(rect.Left, rect.Bottom);
The ScaleToFit() method will scale the image in such a way that it will fit the dimensions of the form field, respecting the original aspect ratio of the image (you don't want to add a stretched image).
You need to page variable to add the image to the correct page:
PdfContentByte canvas = stamper.GetOverContent(page);
canvas.AddImage(image);
Important:
If you add the image as described above, you need to remove the field (this happens automatically if you flatten the form).
If the form field is a button, then you shouldn't use the above code. Instead you should replace the icon of the button. This is described in my answer to the question How to change a Button Icon of a PDF Formular with itextsharp? This answer explains the standard way to do what you're trying to do, but it requires that the field where you want to add the image is a button field (and based on your question, it seems that it's a text field).

How to set max height of a picture in crystal report?

Is it possible to set maximal height of a picture in crystal report and preserve original ratio of a picture?
If can grow is disabled, every picture is streched or shrinked to default picture object size, if is enabled, I'm losing limits of picture size.
I'm using crystal reports for VS 2013 (13.0.5)
Actually I solved this problem for Visual Basic 5.0 and Crystal Reports 6.0 (Seagate version). You asked the newer version but maybe this gives you an idea to solve the problem or it may help some other guys searching an answer for their problems.
Before you assign the report source you can change the height of the picture:
Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(269)
crxFieldObject.Height = theNewHeight
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
PS: After you assign the report source you can not change the height property. Below code does NOT work:
Private Sub Section3_Format(ByVal pFormattingInfo As Object)
Picture1.Height = theNewHeight 'this code does NOT work
End Sub
In this code:
.Sections.Item("D")means the Detail Section of the report and
.Item(269) means the Picture Object. After you insert an OLE Object you can check the item number with a small code such as:
aa = Report.Sections.Item("D").ReportObjects.Count
For i = 1 To aa
Set crxFieldObject = Report.Sections.Item("D").ReportObjects.Item(i)
bb = crxFieldObject.Name
If Mid(bb, 1, 7) = "Picture" Then
crxFieldObject.suppress = False 'You can put a BreakPoint here to check the value of i
End If
Next i
Hope it helps
The answer is No. I did many tests and researches and I didn't found any way to control the height and, without controlling the height, it's not possible to fit an arbitrary image in the object box and keep is ratio at the same time.
Looks like it's and old problem.
But if all your images are limited to the same dimensions, like you have set your limits to 500x500, so you can have, for example, images that do 500x200, 500x500, 250x500, etc., there's a way to do it.
The object box needs to have the same ratio as your limits. In my example, 500x500, the ratio is 1:1 (square) so your object box needs to be square also. You need to check Can grow and, in the Image tab, set the size exactly like the object box's size. You also have to set the bitmap image size (right-click on the box, choose Bitmap Image Object then Modify) to the image limits (500x500).
Perhaps too late, but when you right click on picture -> shaping of the object
You've a checkbox "modular size", uncheck it and put manually the size you want on Image tab.

Typo3 Magic Image resizing

I have a problem,
in my RTE I resize images to a certain size, but after saving, they are reset to either width or height of 300. Smaller sizes are kept, only bigger ones are limited.
I know that there exists a maximum size, after some googleing, i found the following:
RTE.default.buttons.image.options.magic.maxWidth = 1000
RTE.default.buttons.image.options.magic.maxHeight= 1000
RTE.default.buttons.image.options.plain.maxWidth = 1000
RTE.default.buttons.image.options.plain.maxHeight= 1000
But also after inserting it to the PageTS, the images are limited to 300px.
Could someone with more Typo3 experience please help me?
Typo3 version is 6.1.7
I used tx_news and it was impossible to get images larger than 300px width.
I did RTE.default.buttons.image.options.magic.maxWidth = 1000 and styles.content.imgtext.maxWInText = 1000.
The problem is the setMagicImageMaximumDimensions in MagicImageService looks only for RTE.buttons.image.options.magic.maxWidth (no default).
So I have to use,
RTE.buttons.image.options.magic.maxWidth = 1000
There are more constants to define the maximal width of images:
Usage:
styles.content.imgtext {
maxW = XXX
maxWInText = YYY
}
You can also manipulate these widths using registers, which is very helpful to set these values to different values per column. The registers are called maxImageWidth and maxImageWidthInText respectively.