> --
> You received this message because you are subscribed to the Google Groups "ResourceSpace" group.
> To post to this group, send email to resour...@googlegroups.com.
> To unsubscribe from this group, send email to resourcespac...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/resourcespace?hl=en.
>
>
--
Tom Gleason, PHP Developer
ResourceSpace Support Services
https://www.buildadam.com/muse2
Exploring ResourceSpace at:
http://resourcespace.blogspot.com
> For more options, visit this group at http://groups.google.com/group/resourcespace?hl=en.
I think it's a option that has to be turned on when saving the files.
Thank you guys for your feedback and links, VB.net example does not seem
portable in php...
Yes, there's the embedded preview when unzipping it. It is in
\docProps\thumbnail.wmf, it is here!
Is this supposed to work out of the box without Open office and with
exiftool under windows ? If not, it does not look very complex to develop
this feature with exiftool natively in ResourceSpace.
I will have a look with exiftool possibility but I am not a developper. If a
good php skilled guy could have a look on that, it would be awesome!
Keep you posted
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de Tom Gleason
Envoyé : mardi 26 avril 2011 16:59
À : resour...@googlegroups.com
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
Jeff
Just to confirm you that with ExiftoolGUI program all .doc + .docx + pptx +
ppt... thumbnails are correctly displayed :-) but not in RS :-(.
It seems that it just needs to execute this command:
exiftool.exe -b -previewimage" + " " + Chr(34) + FileName + Chr(34) to get
the thumbnail and link it to RS!
Anyone interested in integrating this in php source code?
Cheers
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de Tom Gleason
Envoyé : mardi 26 avril 2011 16:59
À : resour...@googlegroups.com
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
have you checked if there is an embedded preview in your office files?
Have a nice evening
Rgds
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de Jeff Harmon
Envoyé : mardi 26 avril 2011 18:43
À : resour...@googlegroups.com
Cc : <resour...@googlegroups.com>
On Tue, Apr 26, 2011 at 12:52 PM, David ARNOULT - Edition & Internet
Operations <d.ar...@topsolid.com> wrote:
> Thank you Jeff! Looking forward testing it on my instance on Windows :-)
>
> Have a nice evening
>
> Rgds
>
> David
>
>
> -----Message d'origine-----
> De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
> De la part de Jeff Harmon
> Envoyé : mardi 26 avril 2011 18:43
> À : resour...@googlegroups.com
> Cc : <resour...@googlegroups.com>
I am trying to play with exiftool to extract thumbnail from docx for RS but
no results.
I have tried to modify directly php file preview_preprocessing.php like
this:
if ((($extension=="docx") || ($extension=="xlsx") || ($extension=="pptx") ||
($extension=="xps")) && !isset($newfile))
{
#shell_exec("unzip -p $file \"docProps/thumbnail.jpeg\" >
$target");$newfile = $target;
#shell_exec("C:/xampp/unzip/bin/unzip.exe -p $file
\"/docProps/thumbnail.wmf\" > $target");$newfile = $target;
#shell_exec("C:/xampp/7z/7za e -so $file
\"docProps/thumbnail.wmf\" > $target");$newfile = $target;
shell_exec("c:/xampp/exiftool/exiftool.exe -b -previewimage
$file > $target");$newfile = $target;
}
No result.
Then I have tested on command line.
1/ This is working on command line but not in RS:
c:/xampp/7z/7za e -so c:\travail\temp\2.docx "docProps/thumbnail.wmf" >
c:\travail\temp\dam\image_dam.wmf
2/No thumbnail, but it works with a jpg !
c:/xampp/exiftool/exiftool.exe -b –previewimage c:\travail\temp\2.docx >
c:\travail\temp\dam\image_exif.jpg
I have found this page, interesting, an unzip feature/parameter is missing
somewhere on my command line.
http://cpan.uwinnipeg.ca/htdocs/Image-ExifTool/Image/ExifTool/ZIP.pm.html#Pr
ocessZIP-
Rgds
David
-----Message d'origine-----
De : David ARNOULT - Edition & Internet Operations
[mailto:d.ar...@topsolid.com]
Envoyé : mardi 26 avril 2011 18:52
À : 'resour...@googlegroups.com'
Objet : RE: Office files previews (DOCX, XLSX, PPTX)
Thank you Jeff! Looking forward testing it on my instance on Windows :-)
Have a nice evening
Rgds
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de Jeff Harmon
Envoyé : mardi 26 avril 2011 18:43
À : resour...@googlegroups.com
Cc : <resour...@googlegroups.com>
Sorry for my impatience and banging my head (not so strong!).
Thanks for sahirng your code but it does not seem to work on Windows on my
machine.
When I execute on command line as described in your code:
exiftool.exe -b -previewimage 2.docx > 2.jpg
JPG file is always empty and docx file has an embedded thumbnail. It works
fine with jpg or psd.
I have posted this issue on exiftool forum.
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3266.0.html
Keep you posted
Rgds
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de Jeff Harmon
Envoyé : mercredi 27 avril 2011 09:29
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
it is perplexing when i announce to the group that i have this code,
- Jeff
--
Thanks for the links and put this topic up to the pile, I haven't done any
development so far on this topic.
Today this solution works with all ppt and pptx (jpeg format is OK for IM).
Problem appears with Word files that uses wmf format that is not supported
by IM or Exiftool (why not jpeg?).
- Exiftool could be a good option but I have no news about the author and
possibility to read wmf.
- IM could be fine but wmf library does not work completely with all files,
it's a shame. I have tested external library but no success.
- On Windows the python script did not work for me with Open Office, path
problems.
I will investigate with new tools you sent.
Btw, anyone has tested with Office 2010 format? Is it the same format (wmf
for Word/jpg for Powerpoint?)
Keep you posted!
And keep us posted on any progress if you find a solution to display Office
2007/2010 document thumbnails on Windows environment within RS.
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : samedi 4 juin 2011 23:18
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
Hi group.
--
I have tested latest version of exiftool and it can extract now wmf file (as
7-zip can do, like this: shell_exec("C:/Tools/7-zip/7za.exe e -so $file
\"docProps/thumbnail.wmf\" > $target");$newfile = $target;). But it can't be
converted to jpg and processed by IM that can't read wmf... even with libwmf
installed. A white image is always created.
See my post here:
http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3266.0.html
By the mean time I have tested with MS Office 2010 / Word 2010 docx and
thumbnail format has changed to .emf.
It is better, after emf extraction, IM can processed it except full preview
where I have this error:
-Zip (A) 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
Processing archive:
***\include\..\filestore\9\0_fdb2ce845612f27\90_79aec515ccb5709.docx
Extracting docProps\thumbnail.emf
Everything is Ok
Size: 6483696
Compressed: 3690050
Magick: no stream handler is defined
`****\include/../filestore/9/0_fdb2ce845612f27/90_79aec515ccb5709.jpg' @
error/stream.c/QueueAuthenticPixelsStream/843.
Here is my code:
/* ----------------------------------------
Try extract thumbnail Microsoft Office 2007
----------------------------------------
*/
if ((($extension=="xlsx") || ($extension=="xps")) && !isset($newfile))
{
shell_exec("C:/Tools/7-zip/7za.exe e -so $file
\"docProps/thumbnail.wmf\" > $target");$newfile = $target;
#shell_exec("c:/xampp/exiftool/exiftool.pl -b -previewimage $file >
$target");$newfile = $target;
}
if ((($extension=="pptx") || ($extension=="potx")) && !isset($newfile))
{
shell_exec("C:/Tools/7-zip/7za.exe e -so $file
\"docProps/thumbnail.jpeg\" > $target");$newfile = $target;
}
/* ----------------------------------------
Try extract thumbnail Microsoft Office 2010
----------------------------------------
*/
if ((($extension=="docx")) && !isset($newfile))
{
shell_exec("C:/Tools/7-zip/7za.exe e -so $file
\"docProps/thumbnail.emf\" > $target");$newfile = $target;
#shell_exec("c:/xampp/exiftool/exiftool.pl -b -previewimage $file >
$target");$newfile = $target;
}
Any idea is welcome... I have latest IM version on Windows 2003 server x86.
To be continued...
Rgds
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : lundi 13 juin 2011 14:34
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
Thank you Jeff.
--
Just being curious on this topic, I have tested inserting directly the
extracted thumbnail.emf image as a resource in RS.
All previews works, even the Full Screen preview but with this error in
apache logs:
Magick: no stream handler is defined
`***\include/../filestore/9/3_3518d9a134260e0/93_c755664de522454.emf' @
error/stream.c/QueueAuthenticPixelsStream/843.
So I don’t' understand why Full screen preview does not work when inserting
the docx file instead...
I attached the .emf file if you want to have a go on your systems!
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de David ARNOULT - Edition & Internet Operations
Envoyé : lundi 13 juin 2011 14:49
À : resour...@googlegroups.com
Objet : RE: Office files previews (DOCX, XLSX, PPTX)
Save your php file WITHOUT BOM UTF-8 (simple UTF-8). It will simply solve
response body error.
Keep me posted if any progress, looks good to me!
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : mardi 21 juin 2011 15:40
Are you sure that your file encoding is without BOM?
It is a typical error for that.
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : mercredi 22 juin 2011 15:25
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
Hi, the error is the same. I was already saving the file in UTF-8.
--
This is very good news, excellent! I will try your solution ASAP. Will keep
you posted ;-)
Regards
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : samedi 25 juin 2011 17:02
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
I just managed it! Any PPTX, PPT, XLSX, XLS, DOCX and DOC file is now
http://www.artofsolving.com/opensource/pyodconverter
}
--
Thank you for your feedback, I have tested your solution on my Windows 7
local machine and it rocks!
But, when I try to install it on my live RS on Windows too, it does not
work. It works fine by the command line but not from php script :-(
Have you done anything particular on Windows server (rights, path, extra
Python needed?)?
Seems that it is a path problem.
Could you attach your code in a separate txt file to be sure?
RS Debug says:
Starting preview preprocessing. File extension is docx.
create_previews_using_im(ref=1456,thumbonly=,extension=docx,previewonly=,pre
viewbased=,alternative=-1)
SQL: select * from preview_size order by width desc, height desc
Contemplating hpr (sw=, tw=9999999, sh=, th=9999999, extension=docx)
Generating preview size hpr to
G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456hpr_0a322f
2837b9d6c.jpg
Contemplating lpr (sw=, tw=2000, sh=, th=2000, extension=docx)
Contemplating scr (sw=, tw=850, sh=, th=850, extension=docx)
Generating preview size scr to
G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456scr_48458c
d5d39fb71.jpg
Contemplating pre (sw=, tw=350, sh=, th=350, extension=docx)
Generating preview size pre to
G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456pre_f1bcf1
7dc8cb6a9.jpg
Contemplating thm (sw=, tw=150, sh=, th=150, extension=docx)
Generating preview size thm to
G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456thm_83db3f
f5f06d264.jpg
Contemplating col (sw=, tw=75, sh=, th=75, extension=docx)
Generating preview size col to
G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456col_996189
ebff427c9.jpg
Apache log says :
'unzip' n'est pas reconnu en tant que commande interne
ou externe, un programme ex‚cutable ou un fichier de commandes.
Syntaxe du nom de fichier, de r‚pertoire ou de volume incorrecte.
identify.exe: no decode delegate for this image format
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5e
ef4e9cb.docx' @ error/constitute.c/ReadImage/532.
convert.exe: no decode delegate for this image format
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5e
ef4e9cb.docx' @ error/constitute.c/ReadImage/532.
convert.exe: missing an image filename
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456hpr_0a322
f2837b9d6c.jpg' @ error/convert.c/ConvertImageCommand/3015.
convert.exe: no decode delegate for this image format
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5e
ef4e9cb.docx' @ error/constitute.c/ReadImage/532.
convert.exe: missing an image filename
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456scr_48458
cd5d39fb71.jpg' @ error/convert.c/ConvertImageCommand/3015.
convert.exe: no decode delegate for this image format
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5e
ef4e9cb.docx' @ error/constitute.c/ReadImage/532.
convert.exe: missing an image filename
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456pre_f1bcf
17dc8cb6a9.jpg' @ error/convert.c/ConvertImageCommand/3015.
convert.exe: no decode delegate for this image format
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5e
ef4e9cb.docx' @ error/constitute.c/ReadImage/532.
convert.exe: missing an image filename
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456thm_83db3
ff5f06d264.jpg' @ error/convert.c/ConvertImageCommand/3015.
convert.exe: no decode delegate for this image format
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5e
ef4e9cb.docx' @ error/constitute.c/ReadImage/532.
convert.exe: missing an image filename
`G:\Sites\library\include/../filestore/1/4/5/6_59b2de397cf33bc/1456col_99618
9ebff427c9.jpg' @ error/convert.c/ConvertImageCommand/3015.
[Fri Jul 08 16:19:58 2011] [error] [client 192.168.9.108] (20024)The given
path is misformatted or contained invalid characters: Cannot map GET
/pages/%22c:/tools/openoffice/program/python.exe%22%20c:/tools/conv/filestor
e/1/4/5/6_59b2de397cf33bc/filestore/1/4/5/6_59b2de397cf33bc/1456_fa4a7e5eef4
e9cb.jpg.pdf%22../gfx/type1_col.gif HTTP/1.1 to file, referer:
http://library.topsolid.com/pages/upload_swf.php?resource_type=2&collection_
add=&entercolname=&replace=&no_exif=&autorotate=
Thanks!
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : samedi 25 juin 2011 17:02
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
I just managed it! Any PPTX, PPT, XLSX, XLS, DOCX and DOC file is now
http://www.artofsolving.com/opensource/pyodconverter
}
--
Just to let you know that my problem is now solved and DrakoWhole solution
rocks on Windows.
It was brackets syntax problem: I had to simplify the pythoncommand path and
now it works like a charm! It would be worth to integrate it in standard for
Windows users I suppose...
/* ----------------------------------------
Try Microsoft OfficeOpenXML Format
Also try Micrsoft XPS... the sample document I've seen uses the same
path for the preview,
so it will likely work in most cases, but I think the specs allow it
to go anywhere.
----------------------------------------
*/
if ((($extension=="docx") || ($extension=="xlsx") || ($extension=="pptx") ||
($extension=="doc") || ($extension=="xls") || ($extension=="ppt") ||
($extension=="xps") || ($extension=="dot") || ($extension=="dotx") ||
($extension=="pot") || ($extension=="potx")) && !isset($newfile))
{
$pythoncommand = "C:/Tools/OpenOffice/program/python.exe
C:/Tools/DocConv/DocumentConverter.py ";
shell_exec($pythoncommand . $file . " " . $target . ".pdf");
$path_parts=pathinfo($target. ".pdf");
$basename_minus_extension=remove_extension($path_parts['basename']);
$pdffile=$path_parts['dirname']."/".$basename_minus_extension.".pdf";
if (file_exists($pdffile))
{
# Attach this PDF file as an alternative download.
sql_query("delete from resource_alt_files where resource =
'".$ref."' and unoconv='1'");
$alt_ref=add_alternative_file($ref,"PDF version");
$alt_path=get_resource_path($ref,true,"",false,"pdf",-1,1,false,"",$alt_ref)
;
copy($pdffile,$alt_path);unlink($pdffile);
sql_query("update resource_alt_files set file_name='$ref-
converted.pdf',description='Generated by
OpenOffice',file_extension='pdf',file_size='".filesize($alt_path)."',unoconv
='1'where resource='$ref' and ref='$alt_ref'");
# Set vars so we continue generating thumbs/previews as if
this is a PDF file
$extension="pdf";
$file=$alt_path;
}
}
Rgds
David
-----Message d'origine-----
De : resour...@googlegroups.com [mailto:resour...@googlegroups.com]
De la part de DrakoWhole
Envoyé : samedi 25 juin 2011 17:02
À : ResourceSpace
Objet : Re: Office files previews (DOCX, XLSX, PPTX)
I just managed it! Any PPTX, PPT, XLSX, XLS, DOCX and DOC file is now
http://www.artofsolving.com/opensource/pyodconverter
}
--