ImageMagick/BookReader Plugin

Hello

I have looked for an answer to my question but have yet to find one. Perhaps the Omeka community can help.

I am new to Omeka, so I am wondering if there is an alternative to ImageMagick? My host (fasthosts) does not have it installed on their end, thus I cannot use it.

On the back of that question, the plugin BookReader (found here: https://github.com/jsicot/BookReader) is exactly what I am looking for for my site. However, does it require ImageMagick in order to work? If so, bugger. If not, then I cannot seem to figure out how to get it to actually work.

Thanks for stopping by and potentially helping with my questions.

On the ImageMagick question, we use it to create image derivatives for the files you upload. There's not really an alternative, but Omeka will mostly work without it -- you just won't have the thumbnails for files.

I don't think that BookReader requires ImageMagick, though it's not a CHNM plugin, so I'm not that familiar with it.

Thanks for your reply. That's helpful.

If anyone is familiar with bookreader, I could use some help in actually getting it to work! I have installed it, but I must be putting the settings in incorrectly, because nothing seems to come of the plugin. I'm sure it is something simple, like putting the files to be viewed in the correct folder, but any help would be appreciated!

On further inspection, it does not seem so simple. Something about creating a spreadsheet, inserting links to each individual image of a pdf file?

I think I will probably leave it for now.

I'm having a similar problem - I have IA BookReader working in our old version of Omeka, but I can't get it to work in Omeka 2.0. I installed the plugin, but it isn't showing up at all on the item pages. Anyone had luck installing and using this?

Have you edited your theme to add the reader? From glancing at their README, it looks like they don't use Omeka's existing hook for adding stuff to the show page, they expect you to insert a call yourself.

Hi,

Use the new version here https://github.com/Daniel-KM/BookReader. Fix and improvments are always slow to be taken into account.

Bookreader is now displayed by default for ease of use. The hook is no more recommended and a helper or a shortcode can be used if needed. Furthermore, the Bookreader is always available at http://myexample.com/viewer/show/1 too.

About the first question, the BookReader uses only the default original files and the default derivative thumbnails, even if you can set other ones.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

I wasn't able to use the latest version because we don't have the newest version of Omeka. Putting the hook in the item/show.php page worked. Thanks.

Hi,

I upgrade the minimum release to 2.2.2 because it was a secured release of Omeka, so everybody should use it. Anyway, the plugin should work with Omeka 2.1 or even 2.0, just change the plugin.ini.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Greetings,

I've installed and activated the BookReader plugin but can't figure out how to make it work. I have several PDF files, each consisting of around 50 or so pages. Can the BookReader flip the pages within the file?
If I could contact someone off-forum to give me some guidance, that would be greatly appreciated.
Alex Kustanovich
St. Francis College
akustanovich@sfc.edu

It is my understanding that the BookReader plugin only works with image files (such as jpg), not pdf files.

I hope to hear that I am mistaken, as I have a number of PDF/A files that have been OCRed for keyword searching, and I would love to present them in BookReader's page-turning display!

Thank you for responding to my query. It's a bummer that PDF files don't work with the BookReader. Ours are OCRed as well. I can convert the PDF files to jpegs. Each page will be a different file, which is very time-consuming to upload. Do you know how to get the BookReader plugin to read only those images and NOT the other images we have in Omeka. I can't figure out how to do that. Thanks in advance for any help.
Alex Kustanovich
St. Francis College

Hi,

BookReader uses only images, not pdf. The main interest is that jpg are lighter than digitized pdf, so the turning of the pages is very quick. This is not time consuming to upload with CsvImport, because it is done in the background. Texts are imported separately with another plugin (PdfText and PdfToc), or via import of Alto files.

Anyway, you can use PdfEmbed (in the official add-ons on this site) and there will be a new and simpler solution in a few days.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi,

If you want to use pdf directly, there is another new widget, the Universal Viewer for Omeka (https://github.com/Daniel-KM/UniversalViewer4Omeka).

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

Thanks very much for your response. I will definitely check out the Universal Viewer.

I got the BookReader to work with jpegs... sort of. In installed the PHP code for the reader on show.php page. However, it appears at the very bottom of the page. Also, the photos scroll vertically, not horizontally. Is there a way for me to have the reader at the TOP of the page and have the photos flip vertically, two per page, like in a book? I can do it when I go to a full screen mode, but two per page is not a default. On the configuration page for BookReader plugin I chose 2 per page, but it doesn't seem to work. Thanks very much in advance for your help.

Here's the URL of the page to show you what I mean: http://omeka.sfc.edu/omeka/items/show/10
Alex

Hi,

That works!

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

I was able to make the BookReader work and place it at the top of the page, which is what I wanted.
http://omeka.sfc.edu/omeka/items/show/12

The problem I'm encountering now, however, is the page with PDFs. I haven't installed the PDF reader you suggested because I want to stick with the BookReader for now. But I also want to have a separate collection for keyword searchable PDFs. When I upload PDF, there's a big empty space at the top of the page, where the BookReader should be. I guess every time an item is uploaded, the BookReader thinks it's an image. But since it can't read PDFs, I get an empty space in its place.
http://omeka.sfc.edu/omeka/items/show/11

Is there a way to upload simple PDF without involving the BookReader? Thanks a lot.
Alex

Hi,

The choice of what and how to display is made in the theme, not by the plugin.

In the file items/show.php of your theme, you add something like :

<br />
<pre>
<?php
if ($item->fileCount() == 1):
    $file = $item->getFile();
    // One pdf: simple link if no pdf plugin.
    if ($file->mime_type == 'application/pdf'):
        echo 'Download the pdf:';
        echo file_markup($file, array('imageSize' => 'thumbnail'));
    // Single image.
    else:
        echo file_image('fullsize', array(), $file);
    endif;
// Multiple images, so BookReader.
else:
    echo $this->getBookReader();
endif;
?>
</pre>

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

Thank you so much for your prompt reply, the info, and the code. Regrettably, I don't know PHP. I will insert the code and see what happens.

Thanks again. All the best.

Alex Kustanovich
St. Francis College
Brooklyn, NY

Daniel -

I am excited about the possibilities of the Universal Viewer plugin! First, do I understand correctly that this plugin is intended to be used as an adjunct to BookReader? I have installed and configured BookReader on my test site, and it worked well with images, but with the variety of formats we have, I really needed something like this!

I am now trying to install UV on my test site. I have downloaded/unzipped/included the last official release as instructed, and the installation went fine. Now, after copying and adding the code for the hook to my items/show.php file, I get two errors:

Notice: Undefined index: view in .../plugins/UniversalViewer/UniversalViewerPlugin.php on line 245
and
Fatal error: Call to a member function universalViewer() on a non-object in .../plugins/UniversalViewer/UniversalViewerPlugin.php on line 245

I see that line 245 is:
'echo $args['view']->universalViewer($args); '

Have I missed specifying arguments?

Do I need to add the Helper as well?

I have only recently started learning php, so concrete examples are most helpful! I will happily refer to documentation once I know what is needed.

And one more question... can you explain a bit more about how it works with CollectionTree?

Thank you!

Hi,

This is not an adjunct to BookReader, but a more modern replacement. BookReader was build more than ten years ago, and it doesn't progress any more (Internet Archive works on archives more than this player). It's last advantage now is its speed of display for simple books.

Currently, the integration of Universal Viewer works only with images and pdf (they are the main objects in Omeka). Some code needs to be changed to integrate audio and video, but the viewer itself works already with it.

For collection tree, the integration is done and the manifest may use it, but there is still a bug somewhere, so the collection tree doesn't appear.

In fact, this is an integration I made for an emergency order for images only, so this is still in beta and I wait for some returns to continue to work on it.

For your question, in your theme, add 'view' => $this in your array of option. Or use the helper echo $this->universalViewer(); that doesn't need it. I changed the readme to recommend it.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi,

To complete the previous answer: I just integrate the audio/video, as long as the item doesn't contain an image and as long as the format of the file is an open one, readable by the browser of the user.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

I think I will probably leave it for now.

Greetings,

I too have a question about the Universal Reader. Daniel was kind enough to provide a code for the Book Reader that separates PDFs from jpegs. And it works fine. Thank you again, Daniel.

Today I decided to live courageously and install the Universal Reader. Since I don't know PHP, I'm blindly following instructions on the plugin site. I downloaded, uncompressed and renamed the folder. Installed it in the plugin folder on the server and configured the plugin in the admin client of Omeka. So far so good. There's this line in the installation instructions -- "uncompress and rename "uv" the last official release of the UniversalViewer in the subdirectory views/shared/javascripts of the plugin." I couldn't find the javascripts folder in views/shared. Hoping everything would work, I went to the items page on the site and got this error --
Omeka has encountered an error
InvalidArgumentException
Could not find file javascripts/uv/lib/embed.js!

The BookReader plugin works just fine, so if I couldn't figure out how to fix the problem in UV, that's okay. But it would be nice if I could get it to work. Any suggestions?
Thanks very much in advance.

Alex

Hi,

The Universal Viewer is the open sourced player of the British/Wales Library. My plugin is just an integration of it in Omeka. It may replace BookReader and some other plugins.

So you have to download the plugin UniversalViewer4Omeka, to unzip and rename it UniversalViewer and to place it in the folder plugins, as any other plugin.
Then you have to download the last release (1.5.8) of UniversalViewer on https://github.com/UniversalViewer/universalviewer/releases. Unlike the plugin, the files inside this zip are not inside a folder, so unzip them in a new folder named uv. Place this folder uv in the subfolder views/shared/javascripts of the plugin. The subfolder javascripts should be created before in views/shared. All these files and folders should be readable (rights 755 / 644).

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Thank you very much, Daniel. I followed your instructions. And this time there's progress.

However, the UV screen doesn't load. It keeps trying to load, but remains black. I'm sure I need to make an adjustment but not clear what.

Here's the page. Scroll down to see what I mean:

http://omeka.sfc.edu/omeka/items/show/11

Sincerely,
Alex

Hi,

Your server uses an old version of php (5.3), and I didn't check the plugin for this version. So I adapted the plugin to run on your server. You can download the last version on Github, and reinstall it. Normally, it will be fine, because UniversalViewer is correctly installed.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Thanks very much, Daniel. I really appreciate all your help.

I made the UniversalViewer work but our library director wants to stay with the BookReader for now, as he likes its layout more. He doesn't mind have a separate item for the PDFs. Oh, well.

Thanks again.

All the best.

Alex

Daniel,

One last thing. I know there's a way to have the item page open in a full screen view with the BookReader, but I have no idea how.

Right now we have it like this:

http://omeka.sfc.edu/omeka/items/show/14

http://omeka.sfc.edu/omeka/items/show/13

One needs to click on full screen view. I want to make the full view a default view. Any suggestions?

Thanks again.

Alex

Hi,

The full viewer has the same url than items, but "show" is replaced by "viewer": http://omeka.sfc.edu/omeka/items/viewer/14.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

Pardon my ignorance, but which file do I go to replace the URL? I assumed it would be in items/show.php in the theme. But it's not there.
I looked through every file in the theme and the BookReader plugin itself. Firebug is telling it's somewhere in HTML: . But it beats me where.

I'm sorry the people on the forum have to read my stupid questions.
Thanks again.

Alex

Hi Daniel,

Pardon my ignorance, but which file do I go to replace the URL? I assumed it would be in items/show.php in the theme. But it's not there.
I looked through every file in the theme and the BookReader plugin itself. Firebug is telling it's somewhere in HTML: omeka/items/show/14. But it beats me where.

I'm sorry the people on the forum have to read my stupid questions.
Thanks again.

Alex

Hi,

In Omeka, there is one url for each item with the format "http://omeka.sfc.edu/omeka/items/show/" + item id. For the player, the format of the url is "http://omeka.sfc.edu/omeka/items/viewer/" + item id.

The plugin doesn't replace the default urls neither the browsing logic of Omeka. So to make a link in your theme, add something like that in the file items/show.php:

<?php echo link_to_item(null, array(), 'viewer') ?>

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

I just pasted the line you provided into items/show.php, but it didn't change anything.
Do I need to add anything to that line?

Thanks.

Alex

Hi,

It should be pasted at the position where you want to see it. It's just a link. I see it just below the main menu.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

I don't think I explained what I needed correctly.
I want to be able to click on any item link on the home page and go straight to the viewer. Is that possible?

Hi,

The BookReader is a simple viewer, it doesn't modify the logic of Omeka. The more you want to roll away of the logic of Omeka, the more you have to modify code of files in the theme.

So if you want to have a link to the full viewer in the home page, you have to look for all the current links in "index.php" and to change them.

It seems you're using the theme "Seasons". In the "index.php", you have:

<h3><?php echo link_to_item(); ?></h3>

You can replace it with:

<h3><?php echo link_to_item(null, array(), 'viewer'); ?></h3>

The same (or similar replacements: there are some other functions that create links) for other pages.

There are two other possibilities: to change the route of the viewer in the file "routes.ini" of the plugin (replace bookreader_viewer.route = "items/viewer/:id" by bookreader_viewer.route = "items/show/:id"), but it will have undesirable collateral effects. The other possibility is to modify or create a plugin that do it for you.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Daniel,

Thank you for your patience with me. I don't know PHP, so I'm flying blind, with your help.

I'm using Emiglio as my theme. Would the procedure be the same as you described.

Alex

Hi,

In that case, copy the Omeka file "application/views/scripts/items/single.php" into your theme, beside "items/show.php" and replace

    <h3><?php echo link_to($item, 'show', strip_formatting($title)); ?></h3>
    <?php if (metadata($item, 'has files')) {
        echo link_to_item(
            item_image('square_thumbnail', array(), 0, $item),
            array('class' => 'image'), 'show', $item
        );
    }

by

    <h3><?php echo link_to($item, 'viewer', strip_formatting($title)); ?></h3>
    <?php if (metadata($item, 'has files')) {
        echo link_to_item(
            item_image('square_thumbnail', array(), 0, $item),
            array('class' => 'image'), 'viewer', $item
        );
    }

In fact, only the two "show" are replaced by "viewer", or you can keep one link to the normal page and replace the second by the viewer.

Sincerely,

Daniel Berthereau
Infodoc & Knowledge management

Hi Daniel,

Thank you so much for the code!
Sorry for the belated response. I was out sick for a few days.

It worked! I really appreciate all your help.

Best,
Alex

i dont know code php