Bugzilla – Attachment 83369 Details for
Bug 21987
Local cover 'thumbnail' size is bigger than 'imagefile' size in biblioimages table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21987: Add tests
Bug-21987-Add-tests.patch (text/plain), 1.90 KB, created by
Jonathan Druart
on 2018-12-18 17:03:38 UTC
(
hide
)
Description:
Bug 21987: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-12-18 17:03:38 UTC
Size:
1.90 KB
patch
obsolete
>From 73ec0f77bf35313da54167e6e514e43bc3c3158c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 18 Dec 2018 14:02:14 -0300 >Subject: [PATCH] Bug 21987: Add tests > >--- > t/db_dependent/Images.t | 39 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 39 insertions(+) > create mode 100644 t/db_dependent/Images.t > >diff --git a/t/db_dependent/Images.t b/t/db_dependent/Images.t >new file mode 100644 >index 0000000000..9e2e509d93 >--- /dev/null >+++ b/t/db_dependent/Images.t >@@ -0,0 +1,39 @@ >+use Modern::Perl; >+use GD; >+use Test::More tests => 4; >+ >+use C4::Images; >+use t::lib::TestBuilder; >+ >+my $schema = Koha::Database->schema; >+$schema->storage->txn_begin(); >+ >+my $builder = t::lib::TestBuilder->new; >+my $biblio = $builder->build_sample_biblio; >+ >+my $path = 'koha-tmpl/intranet-tmpl/prog/img/koha-logo.png'; >+my $koha_logo = GD::Image->new($path); >+ >+{ >+ # True color == 0 >+ $koha_logo->trueColor(0); >+ C4::Images::PutImage( $biblio->biblionumber, $koha_logo ); >+ >+ my @imagenumbers = C4::Images::ListImagesForBiblio( $biblio->biblionumber ); >+ is( scalar(@imagenumbers), 1 ); >+ my $image = C4::Images::RetrieveImage($imagenumbers[0]); >+ ok( length $image->{thumbnail} < length $image->{imagefile}, 'thumbnail should be shorter than the original image' ); >+} >+ >+{ >+ # True color == 1 >+ # Note that we are cheating here, the original file is not a true color image >+ $koha_logo->trueColor(1); >+ C4::Images::PutImage( $biblio->biblionumber, $koha_logo, 'replace' ); >+ >+ my @imagenumbers = C4::Images::ListImagesForBiblio( $biblio->biblionumber ); >+ is( scalar(@imagenumbers), 1 ); >+ my $image = C4::Images::RetrieveImage($imagenumbers[0]); >+ ok( length $image->{thumbnail} > length $image->{imagefile}, 'thumbnail should be bigger than the original image.' ); >+ # Actually it should not be bigger, but we cheat with the trueColor flag >+} >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21987
:
83369
|
83370
|
86215
|
86525
|
86526