preview creation not working for docs

596 views
Skip to first unread message

pewang

unread,
May 12, 2013, 5:27:07 PM5/12/13
to resour...@googlegroups.com
Hello group,
I have mentioned this issue a couple times in other posts. I'm sorry for insisting in my request for help. I'm desperate.
I have RS installed on a Synology NAS device.
It functions very well except for preview creation for documents. I'm not getting any previews for PDF or office files (DOC, DOCX, etc).
Image previews are created and function well, though they take forever upon upload. The bigger the file, the longer the "ingestion."
I am using the SVN trunk version of RS, just updated to 4444.
I have all the tools installed and passing the installation check. The NAS device comes with Synology's Linux distro (DSM 4.2, seemingly pretty flexible and customizable), for which i've found a bootstrap installer, allowing me to use the ipkg package management system. I've then used that to install ImageMagick, Ghostscript, xpdf (whatever versions were available, unfortunately not the latest). FFmpeg came with, and i was able to install Antiword and Exiftool from the source (BTY i don't know if antiword is functioning correctly, not part of install check). I've spend a lot of time trying to update ImageMagick and Ghostscript to the latest versions by installing from the source but have had no success.
My current versions:
PHP = 5.3.21
MySQL = 5.1.49
ImageMagick = 6.6.9-1
Ghostscript = GPL 8.71
FFmpeg = "ffmpeg unknown" (but seems to be working fine)
Exiftool = 9.28
My PHP settings have been adjusted. I've added the paths to the open_basedir restrictions so as to allow access (without that installation check would fail).
Could it be that there is some kind of restriction being applied somewhere preventing RS from running ghostscript properly? Or any other file processing tools that RS uses?
Will be for ever grateful for any help.
Jeremi

Jeff Harmon

unread,
May 12, 2013, 7:28:58 PM5/12/13
to resour...@googlegroups.com, resour...@googlegroups.com
Try making Ghostscript by hand outside of the package system and point the path in your config to your manually made version. 

Jeff

--
Jeff Harmon
Chief Executive Officer
Colorhythm LLC

Main Office:  +1 415-399-9921
Mobile:  +1 510-710-9590

--
You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremi Plazas

unread,
May 12, 2013, 7:51:22 PM5/12/13
to resour...@googlegroups.com
Thanks for the swift reply Jeff,
I have tried compiling ghostscript myself. I've tried the latest version, another older version, even the exact same version of GS that my package manager uses... but no luck.
For example, when i tried installing from source the same version as ipkg did, this is what i got (./configure was fine, this is the last few lines of "make")

gcc -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long"   -I./base -o ./obj/genarch ./base/genarch.c
./obj/genarch ./obj/arch.h
gcc  -DHAVE_FONTCONFIG -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long"   -I./obj -I./base  -o ./obj/gp_getnv.o -c ./base/gp_getnv.c
gcc  -DHAVE_FONTCONFIG -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long"   -I./obj -I./base  -o ./obj/gp_upapr.o -c ./base/gp_upapr.c
./obj/echogs -w ./obj/gconfig_.h -x 2f2a -s This file was generated automatically by unix-aux.mak. -s -x 2a2f
if ( test -f /usr/include/dirent.h ); then ./obj/echogs -a ./obj/gconfig_.h -x 23 define HAVE_DIRENT_H; else true; fi
if ( test -f /usr/include/ndir.h ); then ./obj/echogs -a ./obj/gconfig_.h -x 23 define HAVE_NDIR_H; else true; fi
if ( test -f /usr/include/sys/dir.h ); then ./obj/echogs -a ./obj/gconfig_.h -x 23 define HAVE_SYS_DIR_H; else true; fi
if ( test -f /usr/include/sys/ndir.h ); then ./obj/echogs -a ./obj/gconfig_.h -x 23 define HAVE_SYS_NDIR_H; else true; fi
if ( test -f /usr/include/sys/time.h ); then ./obj/echogs -a ./obj/gconfig_.h -x 23 define HAVE_SYS_TIME_H; else true; fi
if ( test -f /usr/include/sys/times.h ); then ./obj/echogs -a ./obj/gconfig_.h -x 23 define HAVE_SYS_TIMES_H; else true; fi
if ( test -f jpeg/jmemsys.h); then true; else ./obj/echogs -a ./obj/gconfig_.h -x 23 define DONT_HAVE_JMEMSYS_H; fi
gcc  -DHAVE_FONTCONFIG -O2 -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common -DHAVE_STDINT_H -DGX_COLOR_INDEX_TYPE="unsigned long long"   -I./obj -I./base   -o ./obj/gp_unix.o -c ./base/gp_unix.c
In file included from ./base/gp_unix.c:17:
./base/pipe_.h:39: warning: function declaration isn't a prototype
In file included from ./base/gp_unix.c:19:
./base/time_.h:49: error: redefinition of `struct timeval'
./base/gp_unix.c: In function `gp_get_realtime':
./base/gp_unix.c:148: warning: implicit declaration of function `gettimeofday'
make: *** [obj/gp_unix.o] Error 1

I'm thinking it might just not be a system that can handle any of this, i.e. compatibility issue with Syno DSM. Hope not but it seems more and more like it.  :(

Jeremi

Jeremi Plazas

unread,
May 12, 2013, 7:52:43 PM5/12/13
to resour...@googlegroups.com
Still if RS clears the installation check with the ipkg version of GS, then why isn't it running right when i ingest a PDF?

Jeff Harmon

unread,
May 12, 2013, 9:16:50 PM5/12/13
to resour...@googlegroups.com, resour...@googlegroups.com
The installation check looks to see if everything is in its right place, accessible, and sometimes it also check if the application provides version information, etc. 

We've had repeated problems with the packaged Ghostscript that a custom build seems to address successfully. 

Jeff

--
Jeff Harmon
Chief Executive Officer
Colorhythm LLC

Main Office:  +1 415-399-9921
Mobile:  +1 510-710-9590


On May 12, 2013, at 4:52 PM, Jeremi Plazas <kei...@gmail.com> wrote:

Still if RS clears the installation check with the ipkg version of GS, then why isn't it running right when i ingest a PDF?

--

Jeff Harmon

unread,
May 12, 2013, 9:18:53 PM5/12/13
to resour...@googlegroups.com
Sorry for your troubles!

I think your conclusion is likely, though perhaps could benefit from more specificity with further testing. You might ask around the Ghostscript community.  

J


--
Jeff Harmon
Chief Executive Officer
Colorhythm LLC

Main Office:  +1 415-399-9921
Mobile:  +1 510-710-9590

--

Dan Huby

unread,
May 13, 2013, 10:32:00 AM5/13/13
to resour...@googlegroups.com
I think your issue might be due to a lack of CPU power. Synology devices are nice for storage, but lack the power to do any heavy image or document processing.

Dan

Jeremi Plazas

unread,
May 13, 2013, 8:12:03 PM5/13/13
to resour...@googlegroups.com
Thank you all very much. I will look into ghostscript forums, and also might have to resolve myself to using a different machine as the server while maybe still relying on the NAS for the filestore (since it does have good RAID management).
Thanks again for your input.

Oliver Slay

unread,
May 21, 2013, 1:35:00 PM5/21/13
to resour...@googlegroups.com
hi

I just got GhostScript to work on my Synology... 

ipkg install ghostscript  ... . was straightforward...  installed ghostscript (8.71-2), cups, fontconfig, gconv-modules

then in RS - config.php   set the following lines:

$ghostscript_path='/opt/bin';
$ghostscript_executable='gs';

It is a bit slow... It took about 30-45 seconds to upload and convert a single ~2-page PDF... 

I've managed to get over most of the problems with the Synology... but as Dan points out.. there's not much processing power in it.. so operations can take time.. however even if they take time, it's an excellent piece of kit...  (and normally with technology, I find myself pronouncing that 'k' as 'sh'...)

Jeremi Plazas

unread,
Jul 6, 2013, 6:08:11 PM7/6/13
to resour...@googlegroups.com
I have done everything according to what you described Oliver, alas, i still don't get preview for document files.
Am i missing some ipkg installations? Any packages that if missing would prevent this from working correctly? Could it be settings in DSM?
Installation check is fine. Mmmh...

Oliver Slay

unread,
Jul 6, 2013, 8:00:11 PM7/6/13
to resour...@googlegroups.com
Hi
Do you only mean PDF and DOC?  not DOCX?

Here are the settings that I remember... you might have them all... but worth checking... 

Here's my config section for helper paths:
$imagemagick_path '/opt/bin';
$imagemagick_colorspace'sRGB';
$ghostscript_path='/opt/bin';
$ghostscript_executable='gs';
$ffmpeg_path '/usr/syno/bin';
$exiftool_path '/usr/syno/bin';
---------------

When you log putty (ssh) into the Synology, you'll be in /root ... in there is a file .profile ... :
umask 022
PATH=/opt/bin:/opt/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
export PATH
[.. rest omitted..]
-------------

then type "cd /etc"  and look at rc.local:
#!/bin/sh
mount -o bind /volume/@optware /opt
# Optware setup
[ -x /etc/rc.optware ] && /etc/rc.optware start

exit 0
---end of file----------------

In the DSM web ui... Under Control Panel - Network Services -> Web Services -> PHP Settings -> Tick "Customize PHP open_basedir" my open_basedir :=
/opt/bin:/opt/sbin:/etc.defaults:/usr/bin/php:/usr/syno/synoman:/etc:/var/run:/tmp:/var/spool/php:/volume1/@tmp/php:/var/services/web:/var/services/photo:/var/services/blog:/var/services/homes:/usr/syno/bin

That's off the top of my head... also when you upload a smallish PDF... try leaving the page on the upload page for about 5 minutes longer than you think... and see if it isn't just the Synology processing speed...

Oliver

Jeremi Plazas

unread,
Jul 7, 2013, 1:39:23 PM7/7/13
to resour...@googlegroups.com
Actually i don't get previews for any files including DOCX.
Thanks so much for all this, I was missing stuff in each of these files, which i added:
/opt/bin:/opt/sbin: in my PATH in .profile
and the whole line
mount -o bind /volume/@optware /opt
in rc.local
For some reason my exiftool ended up in usr/bin so that's the path i have, but that seems to work fine. 
I also made sure that path is listed in open_basedir.
I added all that and restarted the DiskStation but still no luck. No preview creation for a small PDF, and i even waited a while at the upload page after the file seemed fully ingested, but nope.
In the installation process I ended up disabling the safe_mode in PHP settings in the DSM web ui, should I turn it back on or is it not related to any of this?
Thanks so much for the help, it's reassuring that someone in this group has made it work on a synology.
Jeremi

Oliver Slay

unread,
Jul 8, 2013, 11:00:45 AM7/8/13
to resour...@googlegroups.com
Hi
The .profile path affects your path when you log in... 

The rc,local affects what is loaded when you reboot.. the mount loads the ipkg installed programs location up to /opt so then the open_basedir and other calls to /opt/sbin and /opt/bin all work ok... 

and the open_basedir setting in DSM .. tells the http server that it is allowed to see this location on the disk and run files from it... 

In PHP Settings I only have 'Enable PHP Cache', "Enable display_errors..." and "Customize PHP open_basedir" .. so the "safe_mode" setting doesn't need to be set for it to work...

You won't get DOCX previews without UnoConv... I don't think.  The only preview you could get via ExifTool (or RS Upload) is the Preview image that is saved with a Word DOCX when you click 'Save Preview' in the Word Save File dialog box.  That inserts an image into the DOCX... however it saves a different file depending on your system (Mac/PC?)... only one of which is detected by RS from the DOCX package.

I need to check with you what you mean by previews..  because on my system I see perhaps a single page.. for a PDF and Word.. and occasionally a page for DOCX... but on the live server I installed UnoConv and I can see Preview pages for all pages in the document... 

Were you hoping for the latter?

Oliver

Jeremi Plazas

unread,
Jul 8, 2013, 11:25:43 AM7/8/13
to resour...@googlegroups.com
Well, to tell you the truth, at this point any kind of preview would be nice, for PDFs especially (but also office files). When i did other trial installations on both Mac and PC, it was really nice to be able to navigate through the pages of a PDF, but even just seeing the cover page would satisfy me at this point. I'm working on getting a separate dedicated server running ubuntu for the installation eventually, that'll solve my problems i think but in the meantime, any kind of previewing (especially for PDF would be great). I realize DOCX are a bit more complicated and am fine waiting to be able to setup unoconv. It just seemed like the PDF previews were a no brainer though. Alas.

Jeremi

Oliver Slay

unread,
Jul 8, 2013, 11:41:04 AM7/8/13
to resour...@googlegroups.com
Also.. here's a list of ipkg packages that I have installed... I'm not sure that all are relevant... 

use "ipkg list_installed" - to get a list - i highlighted any that i remember being required but possibly I have not remembered everything..:

apr - 1.4.6-1 - Apache Portable Runtime library
apr-util - 1.4.1-1 - Apache Portable Runtime utilities library
bzip2 - 1.0.6-1 - Very high-quality data compression program
cups - 1.4.6-1 - Common Unix Printing System
e2fslibs - 1.41.14-1 - Ext2 Filesystem Libraries
expat - 2.0.1-1 - XML Parser library
file - 5.12-1 - Ubiquitous file identification utility.
fontconfig - 2.8.0-0 - Font configuration library
freetype - 2.3.6-1 - Free truetype library
gconv-modules - 2.5-1 - Provides gconv modules missing from the firmware.  These are used by glibc iconv() implementation.
gdbm - 1.8.3-4 - GNU dbm is a set of database routines that use extensible hashing. It works similar to the standard UNIX dbm routines.
ghostscript - 8.71-2 - An interpreter for the PostScript (TM) language
imagemagick - 6.6.9.1-1 - A set of image processing utilities.
libdb - 4.2.52-3 - Berkeley DB Libraries
libjpeg - 6b-3 - collection of jpeg tools
liblcms - 1.19-1 - A small-footprint, speed optimized color management engine.
libpng - 1.2.44-1 - Portable Network Graphics Libraries
libstdc++ - 6.0.9-6 - Standard C++ library, needed for dynamically linked C++ programs
libtiff - 3.9.5-1 - Tag Image File Format Libraries
libtool - 1.5.26-1 - Library tools.
libxml2 - 2.7.8-1 - Libxml2 is the XML C parser and toolkit developed for the Gnome project.
ncurses - 5.7-3 - NCurses libraries
neon - 0.29.6-1 - an HTTP and WebDAV client library, with a C interface
openldap-libs - 2.3.43-2 - Open Lightweight Directory Access Protocol
openssl - 0.9.8v-2 - Openssl provides the ssl implementation in libraries libcrypto and libssl, and is needed by many other applications and libraries
perl - 5.10.0-6 - Practical Extraction and Report Language.
psmisc - 22.17-1 - A set of some small useful utilities that use the proc filesystem.
readline - 6.1-2 - The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are
sqlite - 3.7.14.1-1 - SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
svn - 1.7.7-1 - a compelling replacement for CVS
wget - 1.12-2 - A network utility to retrieve files from the Web
zlib - 1.2.5-1 - zlib is a library implementing the 'deflate' compression system                                          .


Jeremi Plazas

unread,
Jul 8, 2013, 2:41:40 PM7/8/13
to resour...@googlegroups.com
I have them all plus some more...
This is my full list...

DiskStation> ipkg list_installed
apr - 1.4.6-1 - Apache Portable Runtime library
apr-util - 1.4.1-1 - Apache Portable Runtime utilities library
binutils - 2.17-2 - The GNU assembler and linker and related tools
bzip2 - 1.0.6-1 - Very high-quality data compression program
cups - 1.4.6-1 - Common Unix Printing System
cyrus-sasl-libs - 2.1.23-2 - Provides client or server side authentication (see RFC 2222).
e2fslibs - 1.40.3-5 - Ext2 Filesystem Libraries
expat - 2.0.1-1 - XML Parser library
file - 5.12-1 - Ubiquitous file identification utility.
fontconfig - 2.8.0-0 - Font configuration library
freetype - 2.3.6-1 - Free truetype library
gcc - 3.4.6-5 - The GNU Compiler Collection.
gconv-modules - 2.3.4-1 - Provides gconv modules missing from the firmware.  These are used by glibc iconv() implementation.
gdbm - 1.8.3-4 - GNU dbm is a set of database routines that use extensible hashing. It works similar to the standard UNIX dbm routines.
ghostscript - 8.71-2 - An interpreter for the PostScript (TM) language
imagemagick - 6.6.9.1-1 - A set of image processing utilities.
libc-dev - 2.3.4-5 - libc development files.
libdb - 4.2.52-3 - Berkeley DB Libraries
libjpeg - 6b-3 - collection of jpeg tools
liblcms - 1.19-1 - A small-footprint, speed optimized color management engine.
libnsl - 2.3.4-4 - Network Services Library
libpng - 1.2.44-1 - Portable Network Graphics Libraries
libstdc++ - 6.0.3-6 - Standard C++ library, needed for dynamically linked C++ programs
libtiff - 3.9.5-1 - Tag Image File Format Libraries
libtool - 1.5.26-1 - Library tools.
libxml2 - 2.7.8-1 - Libxml2 is the XML C parser and toolkit developed for the Gnome project.
make - 3.82-1 - examines files and runs commands necessary for compilation
nano - 2.2.6-1 - A pico like editor
ncurses - 5.7-3 - NCurses libraries
neon - 0.29.6-1 - an HTTP and WebDAV client library, with a C interface
openldap-libs - 2.3.43-2 - Open Lightweight Directory Access Protocol
openssl - 0.9.8v-2 - Openssl provides the ssl implementation in libraries libcrypto and libssl, and is needed by many other applications and librari
perl - 5.8.8-24 - Practical Extraction and Report Language.
perl-archive-zip - 1.16-3 - Archive-Zip - Provide an interface to ZIP archive files.
perl-compress-zlib - 1.42-3 - Compress-Zlib - Interface to zlib compression library.
procmail - 3.22-4 - Versatile email processor.
psmisc - 22.11-1 - A set of some small useful utilities that use the proc filesystem.
readline - 6.1-2 - The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are
sendmail - 8.14.2-2 - The most classic SMTP server.
sqlite - 3.7.14.1-1 - SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
svn - 1.7.7-1 - a compelling replacement for CVS
wget - 1.12-2 - A network utility to retrieve files from the Web
xpdf - 3.02-1 - Various PDF tools (no support for X11 compiled in)
zlib - 1.2.5-1 - zlib is a library implementing the 'deflate' compression system.
Successfully terminated.

Do you think some could be causing conflict?
Thanks for taking the time. 

Jeremi Plazas

unread,
Jul 8, 2013, 2:57:03 PM7/8/13
to resour...@googlegroups.com
I just noticed some version numbers are different, newer for you... like perl for example...
Do you have more than one source for your ipkg packages? 
I've started using the iPKGui beta package for DSM, and have noticed you can add sources
right now all i have is


I updated it and everything's up to date. 
What model Synology do you have? I used the bootstrap from


hmmm...
If this is getting out of the ResourceSpace world i'm happy to do email (if needed).
Jeremi

Oliver Slay

unread,
Jul 8, 2013, 3:35:06 PM7/8/13
to resour...@googlegroups.com
I recently updated DSM to DSM 4.2-3211... ? .. it's a DS212j

I've not added any extra sources to the current list... 

ipkg status 'perl' :
Package: perl
Version: 5.10.0-6
Depends: libdb, gdbm
Status: install ok installed     <- means it was installed during the install of another package.

It seems to have been installed last year in May - perhaps that's when I got it... or it was installed and touched to have that date for install fingerprinting reasons...   the perl link to the 5.10.0 folder was created this year when I installed ipkg..

I think the next step would be to run the same commands that resourcespace is running from ssh ... on a pdf file...   which means we should remain here... and it might prove useful for someone else who has the same problem ... rather than have the conversation stop... it's always frustrating when that happens on IT forums.. :-)

Oliver

Oliver Slay

unread,
Jul 8, 2013, 3:37:11 PM7/8/13
to resour...@googlegroups.com
I just tested creating previews from PDF...  here's what I tried..

1.  Upload a PDF.. I chose one that was about 90kb.. 
2.  The file uploaded.. so I could see 100% in the upload box...
3.  I did a search for everything (there's only a few files in my system by choice)..  and the PDF has the generic PDF page.
4.  I went to view the PDF.. and the thumbnail is the generic PDF... 
5.  I waited.. pressing F5 to refresh the resource View page... and eventually the PDF preview appeared... 
6.  Click on the preview and I can see all the pages and flick through the 4 pages in the document.

83781  17:15:36  1120_5a6cc497c5e3738.pdf  - PDF is first to be uploaded.
2148  17:15:37  metadump.xml   - then metadata
155249  17:15:40  1120_5a6cc497c5e3738.jpg     - quick.. snapshot.. 
79669  17:15:49  1120scr_2_40e502fb2bdcf5d.jpg   - page preview (page 2)
84793  17:16:03  1120scr_2_wm_01cd70e0e051d6a.jpg  - watermarked page preview (page 2)
82601  17:16:13  1120scr_3_36161e9c77e784f.jpg    (page 3)
87246  17:16:26  1120scr_3_wm_4eb701b20d36d35.jpg  (watermarked page 3)
117862  17:16:38  1120scr_4_2564e8273e2479c.jpg   (page 4)
122571  17:16:51  1120scr_4_wm_17227348dee6823.jpg  (watermarked page 4)
88698  17:17:26  1120scr_9a1e3743ac576ad.jpg    (page 1)
92372  17:17:48  1120scr_wm_eb64c5b7b9a9abe.jpg  (watermarked page 1)
15866  17:17:54  1120pre_f72d11ad7b222f1.jpg   preview image for Resource View page
15866  17:18:00  1120pre_wm_eec3eeed793fefb.jpg   watermarked preview image for Resource View page
3230  17:18:05  1120thm_f464d6896374719.jpg   search results thumbnail
3230  17:18:09  1120thm_wm_324537f8d79ee5e.jpg   search results watermarked thumbnail
928  17:18:13  1120col_398d7d94a81c7f2.jpg   - collection thumbnail 
928  17:18:18  1120col_wm_f54a2b2933e5b4e.jpg  - collection watermarked thumbnail 

So.. this took just under 3 minutes for an ~80k file..

A 500kb PDF .. took about 3.5 minutes for 2 pages.

Oliver

Jeremi Plazas

unread,
Jul 8, 2013, 4:13:30 PM7/8/13
to resour...@googlegroups.com
Thanks, 
I replicated your steps for PDF upload (with a 42KB pdf), same negative response.

My skills being what they are, i need a little more help on what commands are used by RS to create PDF preview. 
Would you kindly point me to a page that describes the process or something of the sort? Ghostscript?
I will then try to run them in SSH and see what happens...

I'm also running latest DSM version, 

Also, what packages do you have installed in DSM (if you don't mind me asking)?

Jeremi

Oliver Slay

unread,
Jul 8, 2013, 7:16:41 PM7/8/13
to resour...@googlegroups.com
i've got joomla, drupal, - [ media server, download station, audio station, video station ] - which i don't use...  phpMyAdmin ..  hmm i've got Perl running.. but it says v. 5.8.6-003 .. not sure why that is there.. 

i'll find out about the rs code.. and get back to you via the groups .. 
 
 


--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--


------------------------------------------------
Oliver Slay MIAP DipHealthSci(Open)

Mob: 07930 420656
------------------------------------------------

Oliver Slay

unread,
Jul 8, 2013, 7:27:52 PM7/8/13
to resourcespace
do you get extracted text from PDFs?

Oliver Slay

unread,
Jul 8, 2013, 7:38:29 PM7/8/13
to resourcespace
RS related... 

Have you checked config.php and config.default.php for any change in this default value :

 $enable_thumbnail_creation_on_upload true;
If it is false then no Previews are made.

Oliver

Jeremi Plazas

unread,
Jul 8, 2013, 7:55:17 PM7/8/13
to resour...@googlegroups.com
I have checked both config.php and config.default.php and in both 
 $enable_thumbnail_creation_on_upload true;
so that's not it...
will also browse around...
Thanks for the assistance.
Jeremi

Jeremi Plazas

unread,
Jul 8, 2013, 7:55:48 PM7/8/13
to resour...@googlegroups.com
I do not get extracted texts from PDFs, i really get nothing. 

Oliver Slay

unread,
Jul 8, 2013, 8:34:22 PM7/8/13
to resour...@googlegroups.com
Other config.php settings I can see in the path..  

$exiftool_no_process=array();    <-make sure it doesn't contain 'pdf'
$pdf_pages=30;   <-make sure it doesn't equal 0
$extracted_text_field=72;   <- do you have a field 72?  is it a text field that is available to PDFs?

If the extracted text resource_type_field is ok... then the upload runs extract_text...   if the filename is PDF... then it appears you would need the following to be set:

$pdftotext_path '......';

I don't have any extracted text.. (some things I never checked because it's not a live server..)   

So it looks like we need pdftotext installed... 

Oliver Slay

unread,
Jul 8, 2013, 8:42:13 PM7/8/13
to resour...@googlegroups.com
run:    ipkg install 'xpdf'

Then add this to your config.php ... 

$pdftotext_path '/opt/bin';

That'll get you extracted text from PDFs...  just worked for me.. 

Jeremi Plazas

unread,
Jul 8, 2013, 10:23:59 PM7/8/13
to resour...@googlegroups.com
Ok, have done everything you mentioned and I DO get extracted text now, in a different field than 72 (i had to change that), so... that works.
Still no preview though.


Oliver Slay

unread,
Jul 8, 2013, 11:17:25 PM7/8/13
to resourcespace
It's a good start :-)

So in the code.. the text is extracted.. and then the xml metadump is updated.. (so you'll see an metadump.xml in the filestore with a created time before the preview jpgs)

Do you have 777 rights on the /filestore/tmp folder?

O


On 9 July 2013 03:23, Jeremi Plazas <kei...@gmail.com> wrote:
Ok, have done everything you mentioned and I DO get extracted text now, in a different field than 72 (i had to change that), so... that works.
Still no preview though.

--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremi Plazas

unread,
Jul 9, 2013, 12:47:13 PM7/9/13
to resour...@googlegroups.com
I do have an xml file in the filestore along with that resource. 
No jpegs have been created though. 
Timestamp is just a second after the one for the resource itself.
Just the pdf and the xml file in the resource folder.
Also, yes i do have 777 rights on filestore/tmp

Oliver Slay

unread,
Jul 9, 2013, 2:21:13 PM7/9/13
to resourcespace
ok... from there.. there's a setting - the filesize of the pdf should not be greater than this size (in MBs) otherwise the code stops..  

$preview_generate_max_file_size

then it's looking for a program called 'im-convert' ..  so you might want to try running 'im-convert' .. and try it on the ingested pdf... ?




--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Oliver Slay

unread,
Jul 9, 2013, 2:41:22 PM7/9/13
to resourcespace
Sorry that file might not be necessary... that's if you have $image_alternatives set... 

the code has jumped to another file... for imagemagick processing.. 

If you have anything set for $unoconv_path and pdf is in $unoconv_extensions ... then that might disrupt the PDF preview making process...

the docx preview you can try on an ingested docx... 

unzip -p file.docx "docProps/thumbnail.jpeg" > docxthumb.jpg

or to test if it is and emf file... which RS would not find... 

unzip -p file.docx "docProps/thumbnail.emf" > docxthumb.emf

doc previews

Need $antiword_path and $ghostscript_path to be set...  

----------
I don't seem to have either im-convert nor antiword... 

---
In System Setup... under Downloads / Preview Sizes...  you should have one called Preview with an id of 'pre' and one called Screen with an id of 'scr' ... these are required to create Previews.. 

one command used is 'pdfinfo filename.pdf' ... 

the rest I'll get later... 

Jeremi Plazas

unread,
Jul 9, 2013, 7:21:13 PM7/9/13
to resour...@googlegroups.com
No unoconv setup at all so no worries there...

$preview_generate_max_file_size  is not restricted to anything. It's commented out in config.default, and i don't have it specified in config. So no problem there either.

For DOCX previews: 

I passed the command you mentioned. Nothing happened. So i opened up a docx file from my filestore and realized most of the DOCX files i have in my installation don't have a docProps/thumbnail.jpeg file at all! Nor an emf file for that matter. I also noticed RS had created a jpg file of the same name as the DOCX file in the filestore directory, except it's empty. It's a blank JPG. So then i created a brand new DOCX file in Word 2011 for mac with some text on the first page, unzipped it up and this time there was a docProps/thumbnail.jpeg. So i ingested that file as a test run into RS, nothing, then i passed your command again on that file, which worked. It created a jpeg image in the filestore directory for that file. I renamed that jpeg with the filename of the ingested DOCX, so as to replace the blank JPG that RS had created, refreshed the Resource View page many times, waiting a while, still nothing. Tried preview recreation, still no preview appears at any time. 

Download and Preview sizes in System setup are present and functional.

The pdfinfo command works just fine in ssh, i get a list of information about the pdf, no problem there.

Will try installing antiword, i had difficulties in the past, but i will give it another shot.

Thanks

Oliver Slay

unread,
Jul 9, 2013, 8:05:26 PM7/9/13
to resourcespace
pdfinfo is only used to get the dimensions of the pdf -  if you have: $pdf_dynamic_rip=true

Otherwise the sizes are taken from System Setup for id='scr'

Then on the pdf.. try running (if in config you have $dUseCIEColor=true; then add -dUseCIEColor after '-r150':

gs -dBATCH -r150 -dNOPAUSE -sDEVICE=jpeg -sOutputFile=test1.jpg -dFirstPage=1 -dLastPage=1 -dEPSCrop -dUseCropBox file.pdf

gs -dBATCH -r150 -dNOPAUSE -sDEVICE=jpeg -sOutputFile=test2.jpg -dFirstPage=2 -dLastPage=2 -dEPSCrop -dUseCropBox file.pdf

These should create previews from the pdf into test1 and test2 jpgs... 





--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Oliver Slay

unread,
Jul 9, 2013, 8:09:00 PM7/9/13
to resourcespace
I don't have antiword installed..  I didn't see it in ipkg when i looked briefly...  and I can't find a single docx on my computer amongst many... that have a preview picture saved... it's not exactly the most reliable of methods for getting a preview of a document... especially when I did try to save a preview a month or so ago, my computer saved one that RS is not programmed to see.. (.emf) ...

O


On 10 July 2013 00:21, Jeremi Plazas <kei...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Oliver Slay

unread,
Jul 9, 2013, 8:20:09 PM7/9/13
to resourcespace
as well as trying the gs command.. try the full path... combined with the ghostscript_path you have set in config.php:

$ghostscript_path='/opt/bin';
$ghostscript_executable='gs';

/opt/bin/gs  -dBATCH -r150 -dNOPAUSE........

Jeremi Plazas

unread,
Jul 10, 2013, 12:25:12 PM7/10/13
to resour...@googlegroups.com
First real Hooray!
It all works fine in the command line! Followed all your instructions to the letter and I get jpgs for the designated pages. Both methods with and without the full ghostscript path work.
Now what is preventing RS from using it correctly?!?

Oliver Slay

unread,
Jul 10, 2013, 3:12:50 PM7/10/13
to resourcespace
hmm.. now you need to test whether you can run the gs via the webserver... you could put a php file in the upload or pages folder .. test_gs.php  ... (replace test1.jpg and file.pdf with the full paths of the pdf and output jpg)...

====test_gs.php====
<?php 
include "../include/db.php";
include "../include/general.php";

$output= run_command("/opt/bin/gs -dBATCH -r150 -dNOPAUSE -sDEVICE=jpeg -sOutputFile='test1.jpg' -dFirstPage=1 -dLastPage=1 -dEPSCrop -dUseCropBox 'file.pdf'");

$output= run_command("/opt/bin/gs -dBATCH -r150 -dNOPAUSE -sDEVICE=jpeg -sOutputFile='test2.jpg' -dFirstPage=2 -dLastPage=2 -dEPSCrop -dUseCropBox 'file.pdf'");

?>
==============
For my installation file.pdf (single quotes required around target and source) =
'/volume1/web/resourcespace/filestore/1/1/2/2_9ab35375b9c5a7b/1122_5c71aeda2633d8e.pdf'
test1.jpg=
'/volume1/web/resourcespace/filestore/1/1/2/2_9ab35375b9c5a7b/test1.jpg'

The only bit I had to really find was the /volume/web/resourcespace/ .. that was a guess that got it working... 



--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremi Plazas

unread,
Jul 10, 2013, 3:26:47 PM7/10/13
to resour...@googlegroups.com
Will do,
BTY    I've installed Antiword, it compiled fine, ended up in /root/bin,which i added to the open_basedir path and to the .profile path in /root/.profile, rebooted the diskstation just to make sure,
Tried to recreate preview for a DOC file, nothing. In the filestore there a .jpg.ps file that gets created but when i change the extension to just .jpg, it can't be opened. There is also in the folder a metadump.xml file with the file info in there, even in some cases the content of the file.
Still no preview though.

Jeremi Plazas

unread,
Jul 10, 2013, 3:35:27 PM7/10/13
to resour...@googlegroups.com
Tested it, works like a charm, no hiccups.
Got two jpg files in the directory of my original PDF, pages 1 and 2.

Oliver Slay

unread,
Jul 10, 2013, 7:00:19 PM7/10/13
to resourcespace
So the other problem with installing resourcespace on the Synology .. was the $baseurl setting.. which i had to set to the following because it's installed in a subfolder called resourcespace...:

$storagedir (this is commented out in config.default.php and does not exist in config.php)

What happens if you add:

$target=get_resource_path(1122,true,"",false,"jpg",-1,1,false,"",-1);
die($target);

in front of the first gs command in the test_gs.php?   put the reference of your pdf where the 1122 is... 

Does it give you something like /volume1/web/resourcespace/filestore/1/1/2/2/_nnnn/nnnnnn.jpg  the target for the jpg.

Jeremi Plazas

unread,
Jul 10, 2013, 9:02:56 PM7/10/13
to resour...@googlegroups.com
Yep, i get
/volume1/web/resourcespace/include/../filestore/5/6/6_7287f8321085273/566_f23d4aa40e96f5f.jpg
exactly.

Jeremi Plazas

unread,
Jul 10, 2013, 9:04:54 PM7/10/13
to resour...@googlegroups.com
baseurl seems fine BTY. I have
haven't had any problems there...

Oliver Slay

unread,
Jul 10, 2013, 11:04:08 PM7/10/13
to resourcespace
Just to check... do you have $pdf_pages set ?  It is set to 30 in my config.default.php.

If it were set to 0.. then no pages would be produced.. 




--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jeremi Plazas

unread,
Jul 11, 2013, 12:29:02 PM7/11/13
to resour...@googlegroups.com
same here, $pdf_pages set to 30 in my default config file.
no custom setting in config.

Oliver Slay

unread,
Jul 11, 2013, 7:14:04 PM7/11/13
to resourcespace
The jpg.ps file is an intermediate file... created by Antiword... so the Antiword is working.. 

The code runs : antiword -p a4 'file.doc' > "target.jpg.ps"

Then if that runs ok... it tries to run:

gs -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -sOutputFile='target.jpg' -dFirstPage=1 -dLastPage=1 -dEPSCrop 'target.jpg.ps'

So you could try running that on the jpg.ps .. then open as a jpg..




--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Oliver Slay

unread,
Jul 11, 2013, 7:21:48 PM7/11/13
to resourcespace
But it's almost as if your ghostscript is not working ... can you cut and paste the paths section from your config.php into here? all the external apps/paths/executable bits and nothing else...?  


Oliver Slay

unread,
Jul 11, 2013, 7:36:59 PM7/11/13
to resourcespace
or ... into the test_gs.php we created... you could enter this before the $target = statement...:

$ghostscript_fullpath = get_utility_path("ghostscript");
die($ghostscript_fullpath);


Jeremi Plazas

unread,
Jul 11, 2013, 8:23:16 PM7/11/13
to resour...@googlegroups.com
When i try

gs -dBATCH -dNOPAUSE -sDEVICE=jpeg -r150 -sOutputFile='target.jpg' -dFirstPage=1 -dLastPage=1 -dEPSCrop 'target.jpg.ps'
replacing target.jpg.ps with appropriate file 

I get an error message:

GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.

*** Warning: GenericResourceDir doesn't point to a valid resource directory.
               the -sGenericResourceDir=... option can be used to set this. 

Then goes back to the prompt, no jpg is created.

Here are my paths:

# Paths
$imagemagick_path = '/opt/bin';
$imagemagick_quality=50;   #lowered it to see if it would speed image ingestion... nope
$ghostscript_path = '/opt/bin';
$ghostscript_executable='gs';
$exiftool_path = '/usr/bin';
$pdftotext_path = '/opt/bin';
$ffmpeg_path = '/usr/syno/bin';
$antiword_path='/root/bin';


so adding 
$ghostscript_fullpath = get_utility_path("ghostscript");
die($ghostscript_fullpath);
to the top of test_gs.php gets me:

'/opt/bin/gs'

Jeremi Plazas

unread,
Jul 11, 2013, 8:46:50 PM7/11/13
to resour...@googlegroups.com
A bit more from my config

# MySQL database settings
$mysql_server = 'localhost';
$mysql_username = 'root';
$mysql_password = '*******!';
$mysql_db = 'resourcespace';

$mysql_bin_path = '/usr/syno/mysql/bin';

# Base URL of the installation

Oliver Slay

unread,
Jul 11, 2013, 10:02:12 PM7/11/13
to resourcespace
i think you'd have wider issues if the mysql server settings were wrong...  so we don't need them... 

I don't have a setting for imagemagick_quality... I have colorspace:

$imagemagick_colorspace'sRGB';

The error from gs about GenericResourceDir is probably due to the 'target.jpg'  not having a path.. if there's no defined resource directory then gs doesn't know into which folder it is to put this target.jpg ... if you give it the same path as the target.jpg.ps ... that might clear the error...


--
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/QMSDiB4AB6g/unsubscribe.
To unsubscribe from this group and all of its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Oliver Slay

unread,
Jul 11, 2013, 10:35:06 PM7/11/13
to resour...@googlegroups.com
Also I should just check.. because I noticed you used the word 'ingest' in your first post... that you are using staticsync or the Upload page ?  

Jeremi Plazas

unread,
Jul 17, 2013, 11:12:29 AM7/17/13
to resour...@googlegroups.com
Was away for a while,

I am not using static sync. Just the regular upload page. Also tried to put the full path into that last gs command, still didn't work, got the same error message.

Jeremi


Reply all
Reply to author
Forward
0 new messages