Created attachment 122048 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size
Created attachment 122192 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size Signed-off-by: David Nind <david@davidnind.com>
tools/picture-upload.pl if ( $size > 550000 ) { Hardcoded. Not so nice..
Created attachment 122423 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
From: Salman Ali <salman@outaouais> This is no valid email address
(In reply to Marcel de Rooy from comment #5) > From: Salman Ali <salman@outaouais> > > This is no valid email address Salman, please fix.
Created attachment 122618 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Don't forget to reset the status when you have answered a QA/RM request :)
Hm, I realize it still has the wrong address, I am going to provide an updated patch.
Used: git commit --amend --author "Salman Ali <salman.ali@inLibro.com>"
Created attachment 122759 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
I will feel picky again, sorry in advance.. But.. Why "500KB" on the template when there is 550000 (bytes) hardcoded in the controller script? And... Why 550000? That does not correspond to anything meaningful. Can we harmonise that please? Like 512KB?
(In reply to Jonathan Druart from comment #12) > And... Why 550000? That does not correspond to anything meaningful. Can we > harmonise that please? Like 512KB? If we're updating the file size limit I'd suggest 2MB at least. A photo from a smart phone these days is going to be between 1 and 2MB at least.
IMO, we have 2 possibilities : syspref if we want librarian to be able to change it or koha-conf.xml : if this is something to be set by sysadmin. Any preference ?
We are not asking for making it configurable, only to be meaningful and consistent. I agree with Owen's suggestion, let use 2MB.
Created attachment 130054 [details] [review] Bug 28576: Update the maximum size of an image. This patch modifies the maximum size of a patron's image, from 500KB to 2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a patron, you can now see the supported file types AND the maximum size. The following places are affected by this patch: - Home/Patrons/anyPatron - Home/Tools/Upload patron images - Home/Tools/Patron card creator/Images To test: 1)Search for any patron and go to his page. 2)Hover over the image area on the left and click on the "Add" button. 3)Notice that the message above the choose file button only specifies file types without the maximum size. 4)Add an image bigger than 500KB. 5)Nothing happens. (This is because the maximum size is 5KB) 6)Apply the patch. 7)Repeat steps from 1 to 3. 8)Notice that the message now includes the maximum size. 9)Add an image bigger than 500KB, but smaller than 2MB. 10)The image is succesfully uploaded. 11)Add an image bigger than 2MB. 12)Nothing happens. (The maximum size is now 2MB) 13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and "Home/Tools/Patron card creator/Images". 14)Notice that the maximum size is updated.
Created attachment 130088 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com>
Created attachment 130089 [details] [review] Bug 28576: Update the maximum size of an image. This patch modifies the maximum size of a patron's image, from 500KB to 2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a patron, you can now see the supported file types AND the maximum size. The following places are affected by this patch: - Home/Patrons/anyPatron - Home/Tools/Upload patron images - Home/Tools/Patron card creator/Images To test: 1)Search for any patron and go to his page. 2)Hover over the image area on the left and click on the "Add" button. 3)Notice that the message above the choose file button only specifies file types without the maximum size. 4)Add an image bigger than 500KB. 5)Nothing happens. (This is because the maximum size is 5KB) 6)Apply the patch. 7)Repeat steps from 1 to 3. 8)Notice that the message now includes the maximum size. 9)Add an image bigger than 500KB, but smaller than 2MB. 10)The image is succesfully uploaded. 11)Add an image bigger than 2MB. 12)Nothing happens. (The maximum size is now 2MB) 13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and "Home/Tools/Patron card creator/Images". 14)Notice that the maximum size is updated. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 130306 [details] [review] Bug 28576: Add patron image in patron detail section does not specify image size limit When you try to add an image to a patron in Home/Patrons/anyPatron, it only states the file types that are supported but not the maximum size. If you try to add an image that is bigger than 500 kb, nothing happens and the reason is not presented. This is not the case with the 2 other places where we can add patron images in which they give warnings: Home/Tools/Upload patron images Home/Tools/Patron card creator/Images For now, i simply added the size limit to the file supported message. To test: 1)Search for any patron and go to his page 2)Hover over the image area on the left and click on add 3)Notice the message above the choose file button only specifies file types not size. 4)Add an image bigger than 500 kb 5)Nothing happens 6)Apply patch 7)Repeat steps from 1 to 3 8)Notice the message now includes the maximum size Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 130307 [details] [review] Bug 28576: Update the maximum size of an image. This patch modifies the maximum size of a patron's image, from 500KB to 2MB. Also, in Home/Patrons/anyPatron, when you try to add an image to a patron, you can now see the supported file types AND the maximum size. The following places are affected by this patch: - Home/Patrons/anyPatron - Home/Tools/Upload patron images - Home/Tools/Patron card creator/Images To test: 1)Search for any patron and go to his page. 2)Hover over the image area on the left and click on the "Add" button. 3)Notice that the message above the choose file button only specifies file types without the maximum size. 4)Add an image bigger than 500KB. 5)Nothing happens. (This is because the maximum size is 5KB) 6)Apply the patch. 7)Repeat steps from 1 to 3. 8)Notice that the message now includes the maximum size. 9)Add an image bigger than 500KB, but smaller than 2MB. 10)The image is succesfully uploaded. 11)Add an image bigger than 2MB. 12)Nothing happens. (The maximum size is now 2MB) 13)Repeat the steps 9 to 12 in "Home/Tools/Upload patron images" and "Home/Tools/Patron card creator/Images". 14)Notice that the maximum size is updated. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
All works as described, new allowance hard coded. Everything works here and QA script is happy. Passing QA
No 4K selfies then ^^
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.03
Pushed to 21.05.x for 21.05.12
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.