Bug 25016 - Coce should not return a 1-pixel Amazon cover image
Summary: Coce should not return a 1-pixel Amazon cover image
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 25007
Blocks: 25031
  Show dependency treegraph
 
Reported: 2020-03-28 21:06 UTC by Owen Leonard
Modified: 2020-05-20 09:58 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
This patch improves the display of cover images where Coce is enabled and Amazon is a source. Where the image from Amazon is a 1x1 pixel placeholder (meaning Amazon has no image) it is no longer displayed.
Version(s) released in:
20.05.00, 19.11.06


Attachments
Bug 25016: Coce should not return a 1-pixel Amazon cover image (1.67 KB, patch)
2020-03-29 16:11 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 25016: Coce should not return a 1-pixel Amazon cover image (1.72 KB, patch)
2020-04-15 20:45 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 25016: Coce should not return a 1-pixel Amazon cover image (1.72 KB, patch)
2020-04-16 11:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25016: Coce should not return a 1-pixel Amazon cover image (1.79 KB, patch)
2020-04-16 12:42 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-03-28 21:06:07 UTC
This might be something which should be addressed in the Coce server code, but we can also address it in ours: If the Amazon cover image stored by Coce is a single-pixel placeholder coce.js in the staff client should not return it.
Comment 1 Owen Leonard 2020-03-29 16:11:43 UTC
Created attachment 102058 [details] [review]
Bug 25016: Coce should not return a 1-pixel Amazon cover image

This patch adds an onload function to the JavaScript which loads images
from Coce. In the case where the image is 1 x 1 pixel the image should
be removed.

To test you should have Coce enabled and Amazon.com included in the list
of sources.

 - Apply the patch and view the bibliographic details page under a
  variety of conditions:
   - A title which has a matching Amazon image:
     - The image should load as expected.
   - A title which doesn't have a matching Amazon image
     - The image should not be found in the source at all after the page
       has loaded.
  - Test with local cover images enabled
Comment 2 Lucas Gass 2020-04-15 20:45:15 UTC
Created attachment 103033 [details] [review]
Bug 25016: Coce should not return a 1-pixel Amazon cover image

This patch adds an onload function to the JavaScript which loads images
from Coce. In the case where the image is 1 x 1 pixel the image should
be removed.

To test you should have Coce enabled and Amazon.com included in the list
of sources.

 - Apply the patch and view the bibliographic details page under a
  variety of conditions:
   - A title which has a matching Amazon image:
     - The image should load as expected.
   - A title which doesn't have a matching Amazon image
     - The image should not be found in the source at all after the page
       has loaded.
  - Test with local cover images enabled

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Jonathan Druart 2020-04-16 11:30:50 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2020-04-16 11:31:56 UTC
Created attachment 103078 [details] [review]
Bug 25016: Coce should not return a 1-pixel Amazon cover image

This patch adds an onload function to the JavaScript which loads images
from Coce. In the case where the image is 1 x 1 pixel the image should
be removed.

To test you should have Coce enabled and Amazon.com included in the list
of sources.

 - Apply the patch and view the bibliographic details page under a
  variety of conditions:
   - A title which has a matching Amazon image:
     - The image should load as expected.
   - A title which doesn't have a matching Amazon image
     - The image should not be found in the source at all after the page
       has loaded.
  - Test with local cover images enabled

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Jonathan Druart 2020-04-16 12:42:52 UTC
Created attachment 103082 [details] [review]
Bug 25016: Coce should not return a 1-pixel Amazon cover image

This patch adds an onload function to the JavaScript which loads images
from Coce. In the case where the image is 1 x 1 pixel the image should
be removed.

To test you should have Coce enabled and Amazon.com included in the list
of sources.

 - Apply the patch and view the bibliographic details page under a
  variety of conditions:
   - A title which has a matching Amazon image:
     - The image should load as expected.
   - A title which doesn't have a matching Amazon image
     - The image should not be found in the source at all after the page
       has loaded.
  - Test with local cover images enabled

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Martin Renvoize 2020-04-17 08:29:31 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-05-07 21:11:09 UTC
backported to 19.11.x for 19.11.06