-
Notifications
You must be signed in to change notification settings - Fork 0
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
Include iFrames in Report #13
Comments
Include in report button for iFrames is implemented and can be tested e.g. here. However, unfortunately html2canvas creates a blank snapshot of the iframe. So instead of the iFrame as a whole, we maybe have to select an element within the iFrame as described here. |
Tried with this study, but got:
It would be helpful to log the concrete error in csis_include_in_report.js#L168 |
True, I was expecting the Drupal logger to log such errors, but he doesn't. I will log the error messages directly in the script. The image file itself is created, but it fails when creating the Report Image entity, so I'm guessing that's because there is no GL-step available on that page to which the Report Image could be linked. I need to add it directly to the Study group, but I remember there were some issues with JSON:API altering Group instances. Was couple of months ago, might have been solved by now. I will look into this. |
Yes, this should be the problem now. |
Status @therter ? Answer is here |
Is there a possibility to increase the resolution of the snapshot? This snapshot image is even smaller than the original map shown on the screen. For printing, this is not suitable. Please note the URI of the image: /sites/default/files/styles/max_650x650/. So for some reason the size is limited to max. 650x650px when uploading (?) the image. Is this a restriction at Drupal side or at html2canvas side? |
No, this is not a Drupal or html2canvas restriction, that's just how drupal handles images. The original image taken by html2canvas is this one (your previous URI without the "/styles/max_650x650/public"). Drupal allows to define different image styles, which you can then use in either Views or display modes. That will determine how the image will be shown in the FE. AFAIK we use the default style (so the original image resolution) on all report images. Since you managed to find one in a 650x650 resolution, I guess we have a misconfiguration somewhere. @p-a-s-c-a-l Where exactly did you find this image being displayed? |
On html2canvas side, it is possible to increase the resolution of the image with the scale option. But drupal does not accept such images, because they are too large. In my local instance, I get the following error message:
I will try to increase the allowed file size locally to test images with a higher resolution. |
Oh interesting, I didn't know that. But where is this currently applied? I just took a screenshot of the Study Area for Study 30 and one screenshot of the hazard map. In both cases (image 1, image 2) html2canvas created the images with the same resolution as shown on the website. |
Since the drupal system currently does not accept large images, this isn't applied, yet. |
Right after clicking the include in report button and on preview. So the 650x650 resolution is probably o.k,. for preview mode and we don't have to change it as long as the full resolution is available in the (PDF) report. |
Oh my mistake, I though you said that html2canvas is currently limiting the resolution to 650x650. |
Ah right. Denis just recently included the image in the edit form of the report image and set the formatter style to 650x650. However, that does not impact how the image is later shown in the PDF, so we don't need to fix that. |
To allow the upload of bigger images, the file /usr/local/etc/php/conf.d/uploads.ini has to be created. The content of the file should be something like this:
|
@therter What's the status? How is this solved within our drupal docker container? |
I have added the file upload.ini to the docker-compose.yml. The attempts with the configuration in the folder /app/web/sites/default did not work |
Implemented. But there is still a bug. |
We need iFrame support in csis_include_in_report.js.
Not sure if that's going to work. We can try it with the MCDA App (which is currently broken) until iFrame Support for the Map Component is available.
The text was updated successfully, but these errors were encountered: