Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
1bd9f175
Commit
1bd9f175
authored
Apr 22, 2018
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general: Cleanup
parent
c6d83a8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
16 deletions
+4
-16
neofetch
neofetch
+4
-16
No files found.
neofetch
View file @
1bd9f175
...
@@ -2928,11 +2928,7 @@ get_term_size() {
...
@@ -2928,11 +2928,7 @@ get_term_size() {
get_image_size
()
{
get_image_size
()
{
# This functions determines the size to make
# This functions determines the size to make
# the thumbnail image.
# the thumbnail image.
read
-r
lines columns
<<<
"
$(
stty
size
)
"
# Get terminal lines and columns.
term_blocks
=
"
$(
stty
size
)
"
columns
=
"
${
term_blocks
/*
}
"
lines
=
"
${
term_blocks
/ *
}
"
# Calculate font size.
# Calculate font size.
font_width
=
"
$((
term_width
/
columns
))
"
font_width
=
"
$((
term_width
/
columns
))
"
...
@@ -2957,9 +2953,7 @@ get_image_size() {
...
@@ -2957,9 +2953,7 @@ get_image_size() {
"none"
)
"none"
)
# Get image size so that we can do a better crop.
# Get image size so that we can do a better crop.
size
=
"
$(
identify
-format
"%w %h"
"
$image
"
)
"
read
-r
width height
<<<
"
$(
identify
-format
"%w %h"
"
$image
"
)
"
width
=
"
${
size
%% *
}
"
height
=
"
${
size
##*
}
"
crop_mode
=
"none"
crop_mode
=
"none"
while
((
"
$width
"
>=
(
"
$term_width
"
/ 2
)
||
while
((
"
$width
"
>=
(
"
$term_width
"
/ 2
)
||
...
@@ -2997,14 +2991,8 @@ make_thumbnail() {
...
@@ -2997,14 +2991,8 @@ make_thumbnail() {
if
[[
!
-f
"
$thumbnail_dir
/
$image_name
"
]]
;
then
if
[[
!
-f
"
$thumbnail_dir
/
$image_name
"
]]
;
then
# Get image size so that we can do a better crop.
# Get image size so that we can do a better crop.
if
[[
-z
"
$size
"
]]
;
then
if
[[
-z
"
$size
"
]]
;
then
size
=
"
$(
identify
-format
"%w %h"
"
$image
"
)
"
read
-r
og_width og_height
<<<
"
$(
identify
-format
"%w %h"
"
$image
"
)
"
og_width
=
"
${
size
%% *
}
"
((
og_height
>
og_width
))
&&
size
=
"
$og_width
"
||
size
=
"
$og_height
"
og_height
=
"
${
size
##*
}
"
# This checks to see if height is greater than width
# so we can do a better crop of portrait images.
size
=
"
$og_height
"
((
og_height
>
og_width
))
&&
size
=
"
$og_width
"
fi
fi
case
"
$crop_mode
"
in
case
"
$crop_mode
"
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment