Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.


If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping


Answers may be delayed for posts that do not include sufficient information.

pdf thumbnails are being generated corrupted.

When I upload a pdf file, the thumbnail is being generated, but it will not open because it is corrupted - they do open with Windows Photo Viewer, but everything else (all browsers, photoshop, acrobat, etc) see it as corrupt.
I notice that healthy jpg files start with :

00000000h: FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 60 ; ÿØÿà..JFIF.....`


but the corrupt files do not  Looking further, it seems that Ghostscript v9.05 is the generator:

00000000h: 49 49 2A 00 08 00 00 00 14 00 FE 00 04 00 01 00 ; II*.......þ.....
00000010h: 00 00 02 00 00 00 00 01 03 00 01 00 00 00 C8 00 ; ..............È.
00000020h: 00 00 01 01 03 00 01 00 00 00 02 01 00 00 02 01 ; ................
00000030h: 03 00 03 00 00 00 FE 00 00 00 03 01 03 00 01 00 ; ......þ.........
00000040h: 00 00 01 00 00 00 06 01 03 00 01 00 00 00 02 00 ; ................
00000050h: 00 00 0A 01 03 00 01 00 00 00 01 00 00 00 11 01 ; ................
00000060h: 04 00 01 00 00 00 4E 0B 00 00 12 01 03 00 01 00 ; ......N.........
00000070h: 00 00 01 00 00 00 15 01 03 00 01 00 00 00 03 00 ; ................
00000080h: 00 00 16 01 03 00 01 00 00 00 D3 06 00 00 17 01 ; ..........Ó.....
00000090h: 04 00 01 00 00 00 B0 5C 02 00 1A 01 05 00 01 00 ; ......°\........
000000a0h: 00 00 04 01 00 00 1B 01 05 00 01 00 00 00 0C 01 ; ................
000000b0h: 00 00 1C 01 03 00 01 00 00 00 01 00 00 00 28 01 ; ..............(.
000000c0h: 03 00 01 00 00 00 02 00 00 00 29 01 03 00 02 00 ; ..........).....
000000d0h: 00 00 00 00 00 00 31 01 02 00 15 00 00 00 14 01 ; ......1.........
000000e0h: 00 00 32 01 02 00 14 00 00 00 2A 01 00 00 73 87 ; ..2.......*...s‡
000000f0h: 07 00 10 0A 00 00 3E 01 00 00 00 00 00 00 08 00 ; ......>.........
00000100h: 08 00 08 00 00 00 00 18 00 00 00 01 00 00 00 18 ; ................
00000110h: 00 00 00 01 47 50 4C 20 47 68 6F 73 74 73 63 72 ; ....GPL Ghostscr
00000120h: 69 70 74 20 39 2E 30 35 00 00 32 30 31 37 3A 30 ; ipt 9.05..2017:0
00000130h: 37 3A 30 34 20 31 33 3A 34 37 3A 32 34 00 00 00 ; 7:04 13:47:24...


Any pointers?
Bruce

Comments

  • That file is a TIFF (TIFF's start with the bytes 49 49 2A 00). Why it's generating TIFFs is the question.
  • well, my media_processing.conf is stock and looks ok:
    MEDIA_TRANSFORMATION_RULES = {
            # ---------------------------------------------------------
            # Image rules
            # ---------------------------------------------------------
            rule_preview_image = {
                SCALE = {
                    width = 180, mode = width, antialiasing = 0.5
                },
                SET = {quality = 75, format = image/jpeg}
            },...

    anywhere else to look?
    Bruce
  • What is the name of this file?
  • The TIFF I mean
  • Could it have something to do with scaling? In /app/lib/core/Plugins/Media/PDFWand.php ~ line 588 the -sDEVICE= is being set to tiff24nc by $vn_scaling_correction being set.

        switch($ps_mimetype) {
                        case 'image/jpeg':
                            exec($this->ops_ghostscript_path." -dNumRenderingThreads=6 -dNOGC -dNOPAUSE -dBATCH -sDEVICE=".($vn_scaling_correction ? "tiff24nc" : "jpeg")." {$vs_antialiasing} -dJPEGQ=".$vn_quality." -dFirstPage=".$vn_start_page." -dLastPage=".$vn_end_page." -dMaxPatternBitmap=1000000 -dBandBufferSpace=500000000 -sBandListStorage=memory -dBufferSpace=1000000000 -dBandHeight=100 -sOutputFile=".caEscapeShellArg($ps_filepath.".".$vs_ext)." -r".$vs_res." -c \"30000000 setvmthreshold\" -f ".caEscapeShellArg($this->handle["filepath"]).(caIsPOSIX() ? " 2> /dev/null" : ""), $va_output, $vn_return);
                        
  • Yes, but it's supposed to convert that TIFF to JPEG in a second conversion.
  • So I still have this problem.
    Could it be related to NOT having pdfminer working?   Because I have not been able to get pdf2txt to run on the shared server I'm on.
    Could that be stalling the last tiff-> jpeg?
    Bruce

  • No that wouldn't be it. They're separate.
    If you want me to look at it send me access details for the server.
  • So following up on this. I never really resolved it correctly. I ended up changing /app/lib/core/Plugins/Media/PDFWand.php adding after the exec:
    if ($vn_scaling_correction){ system("convert " . caEscapeShellArg($ps_filepath.".".$vs_ext) . " " . caEscapeShellArg($ps_filepath.".".$vs_ext) );}

    Its a complete hack, but I don't see where the 2nd conversion would happen
Sign In or Register to comment.