---- Reported by rch@liblime.com 2007-11-29 19:17:28 ---- look first for local content, then query external source e.g. amazon --- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:32 UTC --- This bug was previously known as _bug_ 1633 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=1633 Actual time not defined. Setting to 0.0 The original reporter of this bug does not have an account here. Reassigning to the person who moved it here: chris@bigballofwax.co.nz. Previous reporter was rch@liblime.com. CC member kdr@ckls.org does not have an account here
Hi All, I have received sponsorship from "Sikh National Archives" to add the ability in Koha to display book covers scanned and stored locally in the server. "Sikh National Archives" have a lot of old / rare books & manuscripts which do not have ISBN hence this requirement. Here are the customer requirements in brief : 1. Provide facility to upload scanned cover images linked to biblionumber. 2. Create required mysql tables to hold cover images. 3. Provide global system preference to control display of local cover images in OPAC. 4. Create system preference to decide priority of cover images from multiple providers such as Amazon, Google, Local. 5. Customize OPAC to display only first cover image found as per system preference priority. 6. Customize OPAC search and detail pages to display local cover images linked to biblionumber. 7. Provide user rights management to control upload of images. I have added a RFC to wiki here : http://wiki.koha-community.org/wiki/Local_cover_images_RFC Requesting for comments and suggestions..
What is current state of this bug? I also have need for local cover images and I wouldn't like to duplicate effort. Is source for this changes available somewhere, so we can work on same code?
Created attachment 6242 [details] [review] Patch to enable local cover images The work of adding priority to cover image sources, and failover has been hived off to a separate bug no 7187. How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images. In order to upload local images, login to the staff client. Go to Home › Tools › Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalouge entry and press upload. If uploading in bulk as a zip file, the zip file must contain ( in addition to cover images ) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover Image Files greater than 100K will be refused. Images should be 140x200 pixels. If they are larger they will be auto-resized to comply. If a cover image file is uploaded with a biblionumber which already has matching image in the database it will be overwritten. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages.
* Patch did not apply, giving this message: "fatal: cannot convert from UTF-8utf-8 to UTF-8". Removing 'Content-Type: text/plain; charset="utf-8"' from the patch by hand solved this. * There are a couple of typos in updatedatabase.pl: - "Display local cover mages on OPAC" - "table to stover local cover images" * Comment #3 says "Images should be 140x200 pixels. If they are larger they will be auto-resized to comply", but the code in upload-cover-image.pl seems to implement a max size of 200x300 (which is way too big if you ask me): $debug and warn "$filename is $width pix X $height pix."; if ($width > 200 || $height > 300) { # MAX pixel dims are 200 X 300... $debug and warn "$filename exceeds the maximum pixel dimensions of 200 X 300. Resizing..."; * A couple of things in the templates: - opac-detail.tt: Why have alt="No Local Cover Image" when the image is actually displayed? [% IF ( OPACLocalCoverImages ) %] <img src="/cgi-bin/koha/opac-coverimage.pl?bibnum=[% biblionumber %]" alt="No Local Cover Image" class="thumbnail" />[% ELSE %]<span class="no-image">No Local cover image available</span>[% END %] - opac-results.tt: Same problem with the alt text. And there is a missing " after [% SEARCH_RESULT.biblionumber %]. [% IF ( OPACLocalCoverImages ) %] <img src="/cgi-bin/koha/opac-coverimage.pl?bibnum=[% SEARCH_RESULT.biblionumber %] alt="No Local Cover Image" class="thumbnail" />[% ELSE %]<span class="no-image">No Local cover image available</span>[% END %] * Questions/suggestion for enhancement - The note that says "NOTE: Only PNG, GIF, JPEG, XPM formats are supported." when you are about to upload an image could perhaps also mention the restrictions on file size and dimensions? - It looks like images on the result list and detail view will be the same size? It would be nice to have small images in the result list and bigger images on the detail view. - Maybe the max size could be configurable through systempreferences? This will be a great feature, though!
Created attachment 6699 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds that ability. This counter-patch builds on the work by Koustubha Kale at Anant Corporation, but adds the following additional features: 1. Moves the code for handling image retrieval/saving into the Koha namespace 2. The ability to have multiple cover images for a biblio 3. Handling for "full size" (800x600) and thumbnail-size (200x140) images 4. A separate image viewer page 5. Javascript-based handling of cover image placement for the cover images in the OPAC (as opposed to static <img /> tags embedded into pages) 6. Local cover display in the staff client 7. Uploading images directly from the record view How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home › Tools › Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Detailed test plan: 1. Install update (database updates are in installer/data/mysql/atomicupdate/local_cover_images.pl) 2. Enable LocalCoverImages and OPACLocalCoverImages in the Enhanced content preferences screen 3. Upload an image of type GIF, JPEG, PNG, or XPM either from the "Local Cover Image" tool and choosing "Image file" as its type and entering a valid biblionumber, or by viewing a record and clicking the "Upload Image" option under the Edit button in the toolbar 4. View the record in the Intranet and OPAC. The image should show up directly in OPAC search results and details, and there should be an "Images" tab on both the Intranet and the OPAC detail view 5. Upload another image and attach it to the same bibliographic record. 6. Confirm that the new image (only) shows up in the OPAC and Intranet 7. Change the AllowMultipleCovers to "Allow" in the Enhanced content preferences screen 8. Add several images to a bibliographic record 9. Confirm that they all show up in the "Images" tab on the Intranet and OPAC and only one shows up in the main display in the OPAC details and search results pages 10. Create a zip file containing at least one image and a text file "idlink.txt" with one or more lines that looks like this: 1, filename.jpg Replace the '1' with a valid biblionumber, and 'filename.jpg' with the name of the image file you are adding to the zip file 11. Upload the zip file from the "Local Cover Image" tool (being sure to choose "zip file" as the filetype) 12. Check that the image(s) have been attached to the appropriate bibliographic record(s) Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images.
Hi, Tried the patch. Applies cleanly except for a few whitespace errors. But when I try to run the automic update installer/data/mysql/atomicupdate/local_cover_images.pl I got a permission denied. So executable permissions are needed for this file. After I did that the patch works. Also the uploaded image does not show up in the intranet search page. It does show up in the OPAC search page. In both intranet & OPAC the uploaded images DO show up under the images tab in detail page. regards kmkale
Created attachment 6706 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds that ability. This counter-patch builds on the work by Koustubha Kale at Anant Corporation, but adds the following additional features: 1. Moves the code for handling image retrieval/saving into the Koha namespace 2. The ability to have multiple cover images for a biblio 3. Handling for "full size" (800x600) and thumbnail-size (200x140) images 4. A separate image viewer page 5. Javascript-based handling of cover image placement for the cover images in the OPAC (as opposed to static <img /> tags embedded into pages) 6. Local cover display in the staff client details view (there does not seem to be anywhere appropriate to put the cover image in the intranet search results) 7. Uploading images directly from the record view How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Detailed test plan: 1. Install update (database updates are in installer/data/mysql/atomicupdate/local_cover_images.pl) 2. Enable LocalCoverImages and OPACLocalCoverImages in the Enhanced content preferences screen 3. Upload an image of type GIF, JPEG, PNG, or XPM either from the "Local Cover Image" tool and choosing "Image file" as its type and entering a valid biblionumber, or by viewing a record and clicking the "Upload Image" option under the Edit button in the toolbar 4. View the record in the Intranet and OPAC. The image should show up directly in OPAC search results and details, and there should be an "Images" tab on both the Intranet and the OPAC detail view 5. Upload another image and attach it to the same bibliographic record. 6. Confirm that the new image (only) shows up in the OPAC and Intranet 7. Change the AllowMultipleCovers to "Allow" in the Enhanced content preferences screen 8. Add several images to a bibliographic record 9. Confirm that they all show up in the "Images" tab on the Intranet and OPAC and only one shows up in the main display in the OPAC details and search results pages 10. Create a zip file containing at least one image and a text file "idlink.txt" with one or more lines that looks like this: 1, filename.jpg Replace the '1' with a valid biblionumber, and 'filename.jpg' with the name of the image file you are adding to the zip file 11. Upload the zip file from the "Local Cover Image" tool (being sure to choose "zip file" as the filetype) 12. Check that the image(s) have been attached to the appropriate bibliographic record(s) Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images.
The most recent patch resolves the whitespace errors and gives the updater executable permissions. Cover images are not added to the Intranet search results because I found them to be very aesthetically unappealing. Someone with more design ability could easily add them in a follow-up patch, if s/he wanted.
Created attachment 6712 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds that ability. This counter-patch builds on the work by Koustubha Kale at Anant Corporation, but adds the following additional features: 1. Moves the code for handling image retrieval/saving into the Koha namespace 2. The ability to have multiple cover images for a biblio 3. Handling for "full size" (800x600) and thumbnail-size (200x140) images 4. A separate image viewer page 5. Javascript-based handling of cover image placement for the cover images in the OPAC (as opposed to static <img /> tags embedded into pages) 6. Local cover display in the staff client details view (there does not seem to be anywhere appropriate to put the cover image in the intranet search results) 7. Uploading images directly from the record view How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Detailed test plan: 1. Install update (database updates are in installer/data/mysql/atomicupdate/local_cover_images.pl) 2. Enable LocalCoverImages and OPACLocalCoverImages in the Enhanced content preferences screen 3. Upload an image of type GIF, JPEG, PNG, or XPM either from the "Local Cover Image" tool and choosing "Image file" as its type and entering a valid biblionumber, or by viewing a record and clicking the "Upload Image" option under the Edit button in the toolbar 4. View the record in the Intranet and OPAC. The image should show up directly in OPAC search results and details, and there should be an "Images" tab on both the Intranet and the OPAC detail view 5. Upload another image and attach it to the same bibliographic record. 6. Confirm that the new image (only) shows up in the OPAC and Intranet 7. Change the AllowMultipleCovers to "Allow" in the Enhanced content preferences screen 8. Add several images to a bibliographic record 9. Confirm that they all show up in the "Images" tab on the Intranet and OPAC and only one shows up in the main display in the OPAC details and search results pages 10. Create a zip file containing at least one image and a text file "idlink.txt" with one or more lines that looks like this: 1, filename.jpg Replace the '1' with a valid biblionumber, and 'filename.jpg' with the name of the image file you are adding to the zip file 11. Upload the zip file from the "Local Cover Image" tool (being sure to choose "zip file" as the filetype) 12. Check that the image(s) have been attached to the appropriate bibliographic record(s) Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Developers who installed a previous version of this patch may encounter errors in standard installs due to the Koha/Images.pm file not being installed properly. Please use this veresion instead.
Created attachment 6745 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the Koha::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Developers who installed a previous version of the patch for bug 1633 may encounter errors in standard installs due to the Koha/Images.pm file not being installed properly. Please use this veresion instead.
Created attachment 6746 [details] [review] Bug 1633: Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source.
Created attachment 6747 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the Koha::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Developers who installed a previous version of the patch for bug 1633 may encounter errors in standard installs due to the Koha/Images.pm file not being installed properly. Please use this veresion instead. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6748 [details] [review] Bug 1633: Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6749 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the Koha::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Developers who installed a previous version of the patch for bug 1633 may encounter errors in standard installs due to the Koha/Images.pm file not being installed properly. Please use this veresion instead. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6750 [details] [review] Bug 1633: Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Please note that *both* patches are required for the functionality. First apply "Add support for uploading images to Koha" then apply "Display local cover images." Then test as specified in the commit message on the second patch.
Created attachment 6755 [details] [review] Add support for uploading images to Koha Tested the split patches by Jared Camins-Esakov and signed-off.
Created attachment 6756 [details] [review] Display local cover images Tested the split patches by Jared Camins-Esakov and signed-off
Created attachment 6758 [details] [review] Improved styling and no-JavaScript handling for the OPAC OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client
Created attachment 6759 [details] [review] Bug 1633 - Add ability to take book cover images from local img db OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
I just noticed a problem: The images tab is showing up in the OPAC and staff client for all titles, not just titles with local images.
Created attachment 6764 [details] [review] Bug 1633: Don't show image tab when inappropriate This patch corrects the bug spotted by Owen Leonard where the Images tab was showing up even for records that didn't have local cover images attached to them. The tab is now hidden on the OPAC for records that don't have any images. In the Intranet, an Images tab will show for staff with permission to upload images, suggesting that they do so. For staff without that permission, the tab is not shown.
Created attachment 6765 [details] [review] SIGNED-OFF : Add ability to take book cover images from local img db
Created attachment 6766 [details] [review] SIGNED-OFF : Don't show image tab when inappropriate
From an IRC discussion regarding the RetrieveImage sub: <magnuse> chris_n: http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=6755 * chris_n notes that this patch adds a what appears to be unrelated line to Makefile.PL <chris_n> yeah, that sub needs to be changed to return a null value if there is a db error <chris_n> it already logs it <chris_n> ie. if ($sth->errstr) { log error; return;} <chris_n> and then let the caller handle it
(In reply to comment #25) > From an IRC discussion regarding the RetrieveImage sub: > > <magnuse> chris_n: > http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=6755 > * chris_n notes that this patch adds a what appears to be unrelated line to > Makefile.PL Without the added line to Makefile.PL, production-mode Koha installations fail dramatically because of the Koha/Images.pm file not being installed. > <chris_n> yeah, that sub needs to be changed to return a null value if there is > a db error > <chris_n> it already logs it > <chris_n> ie. if ($sth->errstr) { log error; return;} > <chris_n> and then let the caller handle it I can make that change.
Upon further clarification, the change to Makefile.PL is adding a new directory implementing a previously proposed Koha:: namespace. While I'm not against this in principle, I don't recall any formal discussion and/or decision on this move. There should probably be some or at least some reference to it on the wiki. If/when we do add this namespace, it should probably be done as a separate commit with an appropriate amount of verbiage explaining the change and referencing said discussion/decision rather than being buried in a large feature change/addition. My $0.02 worth.
Created attachment 6785 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the C4::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6786 [details] [review] Bug 1633: Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6787 [details] [review] Bug 1633 - Add ability to take book cover images from local img db OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6788 [details] [review] Bug 1633: Don't show image tab when inappropriate This patch corrects the bug spotted by Owen Leonard where the Images tab was showing up even for records that didn't have local cover images attached to them. The tab is now hidden on the OPAC for records that don't have any images. In the Intranet, an Images tab will show for staff with permission to upload images, suggesting that they do so. For staff without that permission, the tab is not shown.
I have revised the patches as requested, and eliminated the Koha:: namespace. Further comments appreciated.
Created attachment 6791 [details] [review] Follow-up fix This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility
Created attachment 6823 [details] [review] Bug 1633 - Interface revisions for the staff client This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
I applied all the patches attached, in the order they are listed, so git log gives me this: $ git log --pretty=oneline --abbrev-commit 23c90fb Bug 1633 - Interface revisions for the staff client 6a652ec Bug 1633: Don't show image tab when inappropriate 7abbc66 Bug 1633 - Add ability to take book cover images from local img db 57eda8a Bug 1633: Display local cover images 38762dd Bug 1633: Add support for uploading images to Koha f99601e Bug 7375 - Update minimum version of Perl to 5.10 I'm marking this failed QA because of the following three blockers. The enhancements would be nice to have, but can be left for later. *** Blockers * No image shown when there is just one LocalCoverImages = On Uploaded one image and attached it to biblionumber = 1. Image shows OK here: /cgi-bin/koha/catalogue/detail.pl?biblionumber=1 But: "There are no images for this record." at /cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=1&imagenumber=1 Changing line 68 of koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt from this: [% IF ( images.size > 1 ) %] to this: [% IF ( images.size > 0 ) %] makes the image display. Uploading a second image makes both of them display correctly. * AllowMultipleCovers does not stop multiple covers With AllowMultipleCovers = "Don't", /cgi-bin/koha/tools/upload-cover-image.pl was automatically set to "Replace existing covers", but I had no problem adding multiple covers to one record. * Always "Click on an image..." On records that have no associated images I always see this: "Click on an image to view it in the image viewer", not this: "No images have been uploaded for this bibliographic record yet. Please upload one.". Changing line 522 in koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt from [% IF ( localimages ) %] to [% IF ( localimages.0 ) %] seems to solve this. I'm not sure, but I think that when there are no images, localimages is an array where the first element is undef, not an array that is undefined - or something like that... *** Enhancements * How can images be deleted? * Thumbnails have empty alt Thumbnails displayed on the right hand side in the image viewer (both OPAC and Intranet) have empty alt attributes: <img alt="" src="/cgi-bin/koha/catalogue/image.pl?imagenumber=3&thumbnail=1" id="3" class="thumbnail"> It could perhaps say alt="Thumbnail" or something similar? * Still possible to see images when OPACLocalCoverImages is off OPACLocalCoverImages = Don't display I can still see the image at /cgi-bin/koha/opac-image.pl?imagenumber=1 * Wrong POD in tools/upload-cover-image.pl? The POD on line 33 of tools/upload-cover-image.pl says: "Files greater than 100K will be refused. Images should be 140x200 pixels. If they are larger they will be auto-resized to comply." I was able to upload an image of 1.3MB without any trouble, and it was resized correctly. The last part of this has perhaps not been updated to take into account the 600x800 pixel max size of the "large" view? * Images in the modification log? When I look at /cgi-bin/koha/tools/viewlog.pl?do_it=1&modules=CATALOGUING&action=MODIFY&object=1 there is no mention of the images there. Perhaps that would be a nice addition, so you could see when images were added, removed etc? * Make it possible to select "main" image when there is more than one Looks like the first image to be uploaded is the one that is displayed in the result list and at the top of a record in detail view. Might be nice if it was possible to select which image should be the "main" one. * Make it possible to replace one specific image among several
Magnus, Thanks for testing. I have five revised patches coming up that fix your blockers, and a few of your enhancements. Hot off the keyboard! (In reply to comment #35) > * No image shown when there is just one > > LocalCoverImages = On > > Uploaded one image and attached it to biblionumber = 1. > > Image shows OK here: /cgi-bin/koha/catalogue/detail.pl?biblionumber=1 > But: "There are no images for this record." at > /cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=1&imagenumber=1 > > Changing line 68 of > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt from this: > [% IF ( images.size > 1 ) %] > to this: > [% IF ( images.size > 0 ) %] > makes the image display. > > Uploading a second image makes both of them display correctly. Fixed > * AllowMultipleCovers does not stop multiple covers > > With AllowMultipleCovers = "Don't", /cgi-bin/koha/tools/upload-cover-image.pl > was automatically set to "Replace existing covers", but I had no problem adding > multiple covers to one record. Fixed > * Always "Click on an image..." > > On records that have no associated images I always see this: "Click on an image > to view it in the image viewer", not this: "No images have been uploaded for > this bibliographic record yet. Please upload one.". > > Changing line 522 in > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt from > [% IF ( localimages ) %] > to > [% IF ( localimages.0 ) %] > seems to solve this. > > I'm not sure, but I think that when there are no images, localimages is an > array where the first element is undef, not an array that is undefined - or > something like that... Fixed > *** Enhancements > > * How can images be deleted? Good point. It is not yet possible. I will put that on my to-do list. > * Thumbnails have empty alt > > Thumbnails displayed on the right hand side in the image viewer (both OPAC and > Intranet) have empty alt attributes: > > <img alt="" > src="/cgi-bin/koha/catalogue/image.pl?imagenumber=3&thumbnail=1" id="3" > class="thumbnail"> > > It could perhaps say alt="Thumbnail" or something similar? Done! > * Still possible to see images when OPACLocalCoverImages is off > > OPACLocalCoverImages = Don't display > > I can still see the image at /cgi-bin/koha/opac-image.pl?imagenumber=1 Not anymore. ;) > * Wrong POD in tools/upload-cover-image.pl? > > The POD on line 33 of tools/upload-cover-image.pl says: "Files greater than > 100K will be refused. Images should be 140x200 pixels. If they are larger they > will be auto-resized to comply." > > I was able to upload an image of 1.3MB without any trouble, and it was resized > correctly. > > The last part of this has perhaps not been updated to take into account the > 600x800 pixel max size of the "large" view? There was incorrect POD, but I changed it.
Created attachment 6973 [details] [review] Bug 1633: Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the C4::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6974 [details] [review] Bug 1633: Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6975 [details] [review] Bug 1633 - Add ability to take book cover images from local img db OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6976 [details] [review] Bug 1633: Don't show image tab when inappropriate This patch corrects the bug spotted by Owen Leonard where the Images tab was showing up even for records that didn't have local cover images attached to them. The tab is now hidden on the OPAC for records that don't have any images. In the Intranet, an Images tab will show for staff with permission to upload images, suggesting that they do so. For staff without that permission, the tab is not shown. This permission also disables returning images via the opac-image.pl and catalogue/image.pl scripts when local cover images have been disabled.
Created attachment 6977 [details] [review] Bug 1633 - Interface revisions for the staff client This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Created attachment 6978 [details] [review] Signed-off patch
Created attachment 6979 [details] [review] Bug 1633: Display local cover images
Created attachment 6980 [details] [review] [SIGNED-OFF] Bug 1633: Display local cover images
Created attachment 6981 [details] [review] [SIGNED-OFF] Bug 1633 - Add ability to take book cover images from local img db
Created attachment 6982 [details] [review] [SIGNED-OFF] Bug 1633: Don't show image tab when inappropriate
Created attachment 6983 [details] [review] [SIGNED-OFF] Bug 1633 - Interface revisions for the staff client
I have signed off all the current patches. The blockers mentioned in comment 35 have all been fixed, as well as some of the enhancements. I have tested uploading large and small jpg and png images to specific records. Upload and display works as expected. When AllowMultipleCovers = "Don't allow" new images for a record with old images automatically overwrite the old ones. I have also tested with a zip-file containing 3 images and a comma separated file called datalink.txt. I hve tested attaching all 3 images to the same record, as well as different images to different records. We can probably think of improvements to this, but it looks like the base functionality is OK, so I think we should get this in now and then we can enhance it later.
Created attachment 7146 [details] [review] Bug 1633: [SIGNED-OFF] Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the C4::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Will add comments on Bugzilla. Patch failed to apply because installer/data/mysql/sysprefs.sql had changed in master. Corrected the same with this new patch.
Created attachment 7147 [details] [review] Bug 1633: [SIGNED-OFF] Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Created attachment 7148 [details] [review] Bug 1633: [SIGNED-OFF] Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the C4::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Will add comments on Bugzilla. Patch failed to apply because installer/data/mysql/sysprefs.sql had changed in master. Corrected the same with this new patch.
Created attachment 7149 [details] [review] Bug 1633: [SIGNED-OFF] Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the C4::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Will add comments on Bugzilla. Patch failed to apply because installer/data/mysql/sysprefs.sql had changed in master. Corrected the same with this new patch.
Created attachment 7150 [details] [review] Bug 1633: [SIGNED-OFF] Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Created attachment 7151 [details] [review] Bug 1633 - [SIGNED-OFF] Add ability to take book cover images from local img db OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Created attachment 7152 [details] [review] Bug 1633: [SIGNED-OFF] Don't show image tab when inappropriate This patch corrects the bug spotted by Owen Leonard where the Images tab was showing up even for records that didn't have local cover images attached to them. The tab is now hidden on the OPAC for records that don't have any images. In the Intranet, an Images tab will show for staff with permission to upload images, suggesting that they do so. For staff without that permission, the tab is not shown. This permission also disables returning images via the opac-image.pl and catalogue/image.pl scripts when local cover images have been disabled. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Created attachment 7153 [details] [review] Bug 1633 - [SIGNED-OFF] Interface revisions for the staff client This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Patch failed to apply because of multiple Content-Type lines in the patch. Corrected the same with this new patch.
(In reply to comment #56) > Created attachment 7153 [details] [review] > Bug 1633 - [SIGNED-OFF] Interface revisions for the staff client > > This patch revises the image viewer page to match other > biblio detail pages: a toolbar, a sidebar menu, etc. > > Additional data is now pulled by imageviewer.pl in order > to provide information necessary for the proper functioning > of the toolbar and menus: item counts, hold availability, > biblio view options. > > Other changes have been made to match the changes in the > OPAC interface like styling of the images and no-javascript > compatibility > > Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> > Signed-off-by: Magnus Enger <magnus@enger.priv.no> > > Patch failed to apply because of multiple Content-Type lines in the patch. > Corrected the same with this new patch. The attachment still has the double content-type lines. Tried amending the patch after it failed to apply during a git bz apply, but could not get rid of the double content-type lines. Any help in this matter is much appreciated.
Created attachment 7156 [details] [review] Bug 1633 - Interface revisions for the staff client This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Patch failed to apply because of multiple Content-Type lines in the patch. Corrected the same with this new patch. http://bugs.koha-community.org/show_bug.cgi?id=6473
Fixed double content encoding and git-bz's hatred of Unicode subjects. For future reference, the double content encoding appears when there is Unicode in the body or subject of the commit message. In this case, the problem was the subject.
QA comments: * C4/Images.pm and C4/UploadedFile.pm have no copyright/ GPL header * have new scripts be perltidied ? * some files uses tab instead of 4 spaces for indentation (and in a given file, there is sometimes a mix of both, for example upload-images.tt) * in UploadCoverImage, the FSF address is wrong, it should be # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * opac-image.pl has a GPL/FSF header, but no copyright 2011, xxx
QA comment: a strange thing: the "upload image" button appear on the staff ONLY if you've set "localCoverImages" syspref, not if you've set "OPACLocalCoverImages". I thought (and still think) we could decide to have cover images on OPAC and not on staff interface (otherwise, why 2 sysprefs !) Other than this, it works well !
Created attachment 7219 [details] [review] Bug 1633: QA follow-up * Show the "Upload images" button when OPACLocalCoverImages is enabled but LocalCoverImages (i.e. local cover images on the staff client) is not * Correct copyright and license comments in new files * perltidy and replace tabs by four spaces
Created attachment 7267 [details] [review] Bug 1633: [SIGNED-OFF] Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com> Rebased the patch because it was failing with koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css due to changes pushed in master. Applies cleanly now.
Created attachment 7268 [details] [review] Bug 1633: QA follow-up * Show the "Upload images" button when OPACLocalCoverImages is enabled but LocalCoverImages (i.e. local cover images on the staff client) is not * Correct copyright and license comments in new files * perltidy and replace tabs by four spaces Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Tested and signed off on QA follow-up patch by Jared Camins-Esakov. Also rebased the patch for Display local cover images as it was failing to apply for file koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css due to changes pushed in master.
Created attachment 7270 [details] [review] Bug 1633: [SIGNED-OFF] Add support for uploading images to Koha A frequently-requested feature for Koha, especially by special libraries, is the ability to upload local cover images into Koha. This patch adds a bibliocoverimage table, and image handling code in the C4::Images module. Key features of the implementation include: 1. The ability to have multiple cover images for a biblio 2. Handling for "full size" (800x600) and thumbnail-size (200x140) images 3. Uploading images directly from the record view The image display functionality by Koustubha Kale of Anant Corporation will follow in a second patch. Special thanks to Koustubha Kale and Anant Corporation for the initial implementation of local cover images, and to Chris Nighswonger of Foundation Bible College for his prior work on patron images. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Will add comments on Bugzilla. Patch failed to apply because installer/data/mysql/sysprefs.sql had changed in master. Corrected the same with this new patch.
Created attachment 7271 [details] [review] Bug 1633: [SIGNED-OFF] Display local cover images This patch adds display of local cover images in the following places: 1. OPAC Results page 2. OPAC Details page 3. Separate image viewer page for the OPAC 4. Intranet Details page 5. Separate image viewer page for the Intranet Display in the Details and (OPAC) Results pages is handled via Javascript rather than via direct embedding, to better handle the situation where most records have local cover images, but a few do not. Local cover images do not currently display in the Intranet Results page How to use/test : Assign user permission to the user Tools > (upload_local_cover_images Upload local cover images). In order to upload local images, login to the staff client. Go to Home > Tools > Upload Cover Images. Here you can upload cover images either singly or in bulk in the form of a zip file. If uploading singly, click on image file, browse the image from your local disk, type in the biblio number of the catalogue entry and press upload. If uploading in bulk as a zip file, the zip file must contain (in addition to cover images) one text file named either datalink.txt OR idlink.txt. This file should have mapping of biblionumber to image file name in the zip one per line with comma or tab as delimiters. For example: 1, scanned_cover_image_of_bib_no_1.jpg 2, scanned_cover_image_of_bib_no_1.jpg Cover images will be resized to a large image of 800x600 and a thumbnail of 200x140. Depending on the setting of AllowMultipleCovers, it is possible to upload multiple images for a single bibliographic record. However, even if multiple covers are permitted, you have the option of replacing the existing covers by checking the "Replace existing covers" option on the upload screen. 1. The patch adds a menu link in Tools from where you can upload local cover images 2. It adds a user permission to enable access control to this menu item under Tools 3. It adds a system preference OPACLocalCoverImages under Enhanced Content. This needs to be turned on to show local cover images in OPAC. Once you have uploaded local images, if you search for the biblio, the local cover should show up in search as well as search detail pages in the OPAC, and the details view in the Intranet. Koustubha Kale is working on another patch which will allow us to set a cover image source priority in system preferences, and which will then gracefully fail over to the next source if image is not available from the first choice source. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com> Rebased the patch because it was failing with koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css due to changes pushed in master. Applies cleanly now.
Created attachment 7272 [details] [review] Bug 1633 - [SIGNED-OFF] Add ability to take book cover images from local img db OPAC Template revisions: - Revised OPAC imageviewer template to match structure of other OPAC pages (with masthead search, footer, etc) - Added link back to detail page (controlled by BiblioDefaultView preference) - Added link style to thumbnails on opac-detail to add a sense of "clickability" to them - Revised OPAC imageviewer template to allow it to function with JavaScript turned off. Now even without JS main image will load, thumbnails will be properly styled, and thumbnail links will work. - Changes to the script are only to pass missing variables to the template TODO: Corresponding changes for the staff client Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Created attachment 7273 [details] [review] Bug 1633: [SIGNED-OFF] Don't show image tab when inappropriate This patch corrects the bug spotted by Owen Leonard where the Images tab was showing up even for records that didn't have local cover images attached to them. The tab is now hidden on the OPAC for records that don't have any images. In the Intranet, an Images tab will show for staff with permission to upload images, suggesting that they do so. For staff without that permission, the tab is not shown. This permission also disables returning images via the opac-image.pl and catalogue/image.pl scripts when local cover images have been disabled. Signed-off-by: Magnus Enger <magnus@enger.priv.no> Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
Created attachment 7274 [details] [review] Bug 1633 - Interface revisions for the staff client This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Signed-off-by: Magnus Enger <magnus@enger.priv.no> Patch failed to apply because of multiple Content-Type lines in the patch. Corrected the same with this new patch. http://bugs.koha-community.org/show_bug.cgi?id=6473
Created attachment 7275 [details] [review] Bug 1633: QA follow-up * Show the "Upload images" button when OPACLocalCoverImages is enabled but LocalCoverImages (i.e. local cover images on the staff client) is not * Correct copyright and license comments in new files * perltidy and replace tabs by four spaces Signed-off-by: Koustubha Kale <kmkale@anantcorp.com>
The patches were out of order on this bug. I just downloaded and reuploaded the patches to get them in the right order. I did not change any of the patches, and they are at their latest state and apply cleanly to master thanks to kmkale's rebasing on January 21. Paul's QA comments have been incorporated, and everything has been signed off.
QA comment : * I made a lot of tests, everything work: - uploading more than 1 image - replacing 2 images by 1 image - uploading the same image on 2 different biblios, removing one - uploading different images on different biblios - displaying on OPAC. There is a glitch on the display, but removing a local css fixes the problem. It means local CSS will have to be updated probably. - tried to upload a file that is not an image. I got a nice: "Cannot process file as an image. Please ensure you only upload GIF, JPEG, PNG, or XPM images." All my comment 60 and comment 61 point have been fixed About comment 61 : I can't see a use case where the library would have OPAClocalcoverimages but not localcoverimages. It would result in something strange, as the librarian could upload his images, but not see the result in the staff. But maybe that will please some libraries, so I'll continue to live with my question ;-) Passed QA,
Congrats everybody !
Created attachment 7312 [details] [review] Bug 1633: Add missing permissions The previous patches missed adding the upload_local_cover_images permission to languages other than en, giving jenkins agitas and indigestion. This patch adds the permission to other languages.
Created attachment 7315 [details] [review] Bug 1633 follow-up: Fix jenkins tests The previous patches missed adding the upload_local_cover_images permission to languages other than en, and used a forbidden TT construct, giving jenkins agitas and indigestion. This patch adds the permission to other languages and corrects the syntax.
Created attachment 7320 [details] [review] Bug 1633 follow-up: Fix jenkins tests The previous patches missed adding the upload_local_cover_images permission to languages other than en, and used a forbidden TT construct, giving jenkins agitas and indigestion. This patch adds the permission to other languages and corrects the syntax.
Tests now pass perl xt/permissions.t unable to locate Koha configuration file koha-conf.xml at C4/Context.pm line 333. ok 1 - Open reference user permissions file installer/data/mysql/en/mandatory/userpermissions.sql ok 2 - Found 48 user permissions ok 3 - Open translated user permissions file installer/data/mysql/de-DE/mandatory/userpermissions.sql ok 4 - Found 48 perms ok 5 - No user permissions to add ok 6 - No user permissions to delete ok 7 - Open translated user permissions file installer/data/mysql/it-IT/necessari/userpermissions.sql ok 8 - Found 48 perms ok 9 - No user permissions to add ok 10 - No user permissions to delete ok 11 - Open translated user permissions file installer/data/mysql/fr-FR/1-Obligatoire/userpermissions.sql ok 12 - Found 48 perms ok 13 - No user permissions to add ok 14 - No user permissions to delete ok 15 - Open translated user permissions file installer/data/mysql/uk-UA/mandatory/permissions_and_user_flags.sql ok 16 - Found 48 perms ok 17 - No user permissions to add ok 18 - No user permissions to delete ok 19 - Open translated user permissions file installer/data/mysql/ru-RU/mandatory/permissions_and_user_flags.sql ok 20 - Found 48 perms ok 21 - No user permissions to add ok 22 - No user permissions to delete ok 23 - Open translated user permissions file installer/data/mysql/pl-PL/mandatory/userpermissions.sql ok 24 - Found 48 perms ok 25 - No user permissions to add ok 26 - No user permissions to delete 1..26 perl xt/tt_valid.t 1..1 ok 1 - TT syntax: not using TT directive within HTML tag
Created attachment 7324 [details] [review] Bug 1633 follow-up: Fix jenkins tests The previous patches missed adding the upload_local_cover_images permission to languages other than en, and used a forbidden TT construct, giving jenkins agitas and indigestion. This patch adds the permission to other languages and corrects the syntax.
Created attachment 7325 [details] [review] Bug 1633 follow-up: Fix jenkins tests The previous patches missed adding the upload_local_cover_images permission to languages other than en, and used a forbidden TT construct, giving jenkins agitas and indigestion. This patch adds the permission to other languages and corrects the syntax. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Created attachment 7334 [details] [review] Followup on kohastructure Fixing typo in last create
QA: Looks good. Updating status. Chris' patch made my last followup obsolete.
(forgot to set version 3.8)
I'm getting reports that local cover image aren't showing on the opac search results - is there a bug with this? Or was this not part of the scope of this patch?
Sorry .. reports in 3.8.2
Changing status to see if I can get an answer on my above comments. Is it working for everyone?
(In reply to comment #84) > I'm getting reports that local cover image aren't showing on the opac search > results - is there a bug with this? Or was this not part of the scope of > this patch? For me, local covers show up nicely in the search results on version 3.08.10.000, when OPACLocalCoverImages is activated. Nicole: Could you open a new bug if this is still a problem for your reporters?
The bug you're looking for, the one where local cover images fail to show, is #9737.