GithubHelp home page GithubHelp logo

Comments (17)

therter avatar therter commented on July 19, 2024 1

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

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

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.

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

Tried with this study, but got:

error posting report image

It would be helpful to log the concrete error in csis_include_in_report.js#L168

from csis-helpers-module.

patrickkaleta avatar patrickkaleta commented on July 19, 2024

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.

from csis-helpers-module.

therter avatar therter commented on July 19, 2024

I'm guessing that's because there is no GL-step available on that page to which the Report Image could be linked.

Yes, this should be the problem now.
First, the request to create the Report Image Entity answered with a 413 Request Entity too large, but since this is solved, the request answers with a 404 The resource identified by 'node--gl_step:-1' (given as a relationship item) could not be found

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

Status @therter ?
What's going on in this branch: bug/9_use_table_div?

Answer is here

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

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?

from csis-helpers-module.

patrickkaleta avatar patrickkaleta commented on July 19, 2024

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.
image-styles

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?

from csis-helpers-module.

therter avatar therter commented on July 19, 2024

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?

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:

Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException: Unprocessable Entity: file validation failed. The file is 2.39 MB exceeding the maximum file size of 2 MB. in Drupal\jsonapi\Controller\FileUpload->handleFileUploadForNewResource() (line 177 of /app/web/core/modules/jsonapi/src/Controller/FileUpload.php).

I will try to increase the allowed file size locally to test images with a higher resolution.

from csis-helpers-module.

patrickkaleta avatar patrickkaleta commented on July 19, 2024

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?

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.

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.

from csis-helpers-module.

therter avatar therter commented on July 19, 2024

But where is this currently applied?

Since the drupal system currently does not accept large images, this isn't applied, yet.

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

Where exactly did you find this image being displayed?

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.

from csis-helpers-module.

patrickkaleta avatar patrickkaleta commented on July 19, 2024

But where is this currently applied?

Since the drupal system currently does not accept large images, this isn't applied, yet.

Oh my mistake, I though you said that html2canvas is currently limiting the resolution to 650x650.

from csis-helpers-module.

patrickkaleta avatar patrickkaleta commented on July 19, 2024

Where exactly did you find this image being displayed?

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.

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.

from csis-helpers-module.

therter avatar therter commented on July 19, 2024

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:

file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

To allow the upload of bigger images, the file /usr/local/etc/php/conf.d/uploads.ini has to be created.

@therter What's the status? How is this solved within our drupal docker container?

from csis-helpers-module.

p-a-s-c-a-l avatar p-a-s-c-a-l commented on July 19, 2024

Implemented. But there is still a bug.

from csis-helpers-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.