mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 23:12:33 -05:00
optimize image blank
This commit is contained in:
1 parent
eef2d9d599
commit
91df5b2407
1 file changed
+4
-2
+4
-2
@@ -4,8 +4,10 @@ module ImageUtils
|
||||
module_function
|
||||
|
||||
def blank?(image)
|
||||
min = (0...image.bands).map { |i| image.stats.getpoint(0, i)[0] }
|
||||
max = (0...image.bands).map { |i| image.stats.getpoint(1, i)[0] }
|
||||
stats = image.stats
|
||||
|
||||
min = (0...image.bands).map { |i| stats.getpoint(0, i)[0] }
|
||||
max = (0...image.bands).map { |i| stats.getpoint(1, i)[0] }
|
||||
|
||||
return true if min.all?(255) && max.all?(255)
|
||||
return true if min.all?(0) && max.all?(0)
|
||||
|
||||
Reference in new issue
Block a user