-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
processingInstructions crop and cropVariant will be ignored #136
Comments
After doing some research, I think the problem is the applyProcessingInstructions call inside the pdf:image viewhelper.
This always results in "0,0,0,0", because the overgiven crop configuration is a multidimensional object with all crop variants, and not only the default one. Finally the type casting (int) in front of $cropData-> will convert all float values like "0.441" to 0. Therefore the overgiven crop has to be converted from the upper format to something like this:
before they are overhanded to the applyProcessingInstructions call. |
@mediaessenz You are absolutely right. I have to admit I never really tested crop variants and I thought that the image service will take care of it, but it does not. A workaround would be to select the corresponding crop area yourself and pass it as <f:variable name="crop" value="{default: {cropArea: {height:100,width:100,x:50,y:50}}}" />
<f:variable name="cropVariant" value="default" />
<f:variable name="cropArea" value="{crop.{cropVariant}.cropArea}" />
<f:variable name="cropString" value="{f:format.json(value: cropArea)}" />
<pdf:image processingInstructions="{crop: cropString}" src="EXT:pdfviewhelpers/Resources/Public/Examples/BasicUsage/Bithost.jpg" /> You probably just have to replace I will have to add a more user friendly support for crop variants to |
Maybe something like this helps ;-)
|
@mediaessenz Thanks for sharing your code! :) |
Just for the records (and not related to
|
I just released |
I seems, that the process instruction properties "crop" and "cropVariant" will be ignored completely.
I try to do something like this:
Independent of any cropping inside the added images, they get not cropped.
If I add this debug output to the upper code right after the pdf:image:
I get the correct settings array, which looks like this:
The text was updated successfully, but these errors were encountered: