-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.9.6, 3.10.3, 3.11
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
-
MDL-71434_master -
-
When you submit the attached source.pdf in an assignment that uses PDF annotation for feedback the file will be converted into a PNG preview image. That's done via these commands:
gs -q -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=target.pdf source.pdf
|
gs -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r100 -dFirstPage=1 -dLastPage=1 -dDOINTERPOLATE -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=page1.png target.pdf
|
For the attached source.pdf this takes 20min in my test with one core at 100% utilization the whole time. (The attached pdf is just one page of an actual pdf file submission of one of our students. I tried converting the original pdf submission but cancelled it after 1.5 hours.) If the conversion happens live as the teacher is in the grading interface it just hangs for him and actually the whole Moodle sessions hangs. He then has to clear cookies and log in again to use Moodle at all.
In MDL-64431 someone suggested using `pdfimage24` instead of `pdfwrite` to solve a different problem. I tried `pdfimage24` here and with it the attached pdf gets converted in only 20s. So a 60x speedup in this case.