Hi,
I'm writing an plugin that create an image from first page pdf, eps files to preview what is in document. After some review I used class-WEBdocs as base of new one.
I have:
In class-WEBdocs use static images, but I want to generate a thumb of image which will be stored in directory. Is there a class for it and can you indicate in which file is used?
Other thing - is there any place to disable scaning for images placed in directory, in albums? (/albums/sample_direcotry)
Do you want to generate a thumb for each document or just a different default thumb? For the former, just place the generated thumb in the folder. The filename of the thumb should be the same as the document except that the suffix should be that of an image rather than pdf. If you want to have a different default thumb, create that image and place it in your plugins/class-WEBdocs folder. Name it pdfDefault.png.
There is a plugin that will disable scanning of folders and/or file suffixes. It is named filter-fileSearches and may be found in our repository of unsupported code on GitHub.
After some work and testing I came with one problem - getting a full path to file.
$filename = $this->filename;
$album = $this->folder;
$ff_src_file = $_SERVER['DOCUMENT_ROOT'] . '/' . $albums . '/' . $filename;
But have an error with
NOTICE: Undefined property: EXTdocs::$folder in /zp-core/zp-extensions/class-EXTdocs.php on line 138 EXTdocs->getThumbImageFile called from TextObject->getThumb (class-textobject_core.php [162]) from getImageThumb (template-functions.php [2627]) from printImageThumb (template-functions.php [2645]) from include (album.php [56]) from index.php [100]
Have you mayby some good solution for get the right path?
$filename = $this->filename; $album = $this->folder;
That cannot work, first $this is a variable within a class and then images and albums are different objects. EIther it is an album object or an image one. In any case filename and folderwon't work on both.
Please read: http://www.zenphoto.org/news/zenphotos-object-model-framework
and review the documentation of the main Zenphoto classes. If you haven't you should read the theming tutorial as well.
If you just want the full image url there are template functions available.
`
and review the documentation of the main Zenphoto classes. If you haven't you should read the theming tutorial as well.
If you just want the full image url there are template functions available.
You don't understand. I don't use this in theme but in class. I sed: full path to file. Not url - i need something like /home/some/some/albums/test`
What class do you use this in? $this refers to the class object itself. In any case that NEVER can be an image object or an album object at the same time.
home/some/some/albums/test
What is "some" here?
You get the url to an item (which refers to any supported items) within an album via getFullImageURL() if in the right context. Otherwise you need to create an image object first to use the method. Before you can create an image object you need the object of its album. That is explained on the object model tutorial.
If this file is outside the albums and not supported by a plugin like videos you cannot use the object model naturally.
I use: class-textobject_core
I base plugin on: class-WEBdocs
I want to get:
SERVER_DOCUMENT_ROOT/BASE_ALBUM_DIR/ALBUMS/Filename
Like I write above, I want to create an image from uploaded file. For that I need to tell ghostscript from where get file and where storage image file.
I manage to create class (based on other one) that generate pdf/eps/tiff preview. It's have some code to improve/erase but working well.
If someone need, find here: http://pastebin.com/J7iJcWZG
Mayby one day I have time to finish it or mayby someone do it for me