NewGraphEnvironment / newgraphenvironment.github.io

Hugo-Apero themed website
https://newgraphenvironment.github.io
0 stars 2 forks source link

Resize logo #7

Closed lucy-schick closed 10 months ago

lucy-schick commented 10 months ago

We need to resize the logo (nge-full_black.png).

Doesn't look super easy but lots of suggestions here https://stackoverflow.com/questions/48063067/resize-image-in-hugo-v-0-32-x-in-markdown

NewGraphEnvironment commented 10 months ago

here is a potential route. file paths will need to be adjusted

library(fpr)

# see the fpr photo functions
ls('package:fpr')

# check out a relevant function
?fpr_photo_resize_convert

# check out the actual function code
fpr_photo_resize_convert

# check out some info about the magick package ( https://cran.r-project.org/web/packages/magick/vignettes/intro.html#Read_and_write )
# know that like many other packages it just wraps another program - google search "magick man pages" reveals https://linux.die.net/man/1/imagemagick

library(magick)
# read in the image
i <- magick::image_read('fig/nge-full_black.png')

# see info about the image
print(i)

# since its just a resize here and there vs processing many images - rather than use fpr_photo_resize_convert to replace the logo
# or make a new directory for receiving resized image recreate the function moves manually
i_scaled <- magick::image_scale(i, "200" )
magick::image_write(i_scaled, 'fig/nge-full_black_resized.png')
NewGraphEnvironment commented 10 months ago

Guessing the issue here is the size of the widget and not the size of the PNG that we are feeding it. Maybe a decent workaround is just using the logo only without any of the writing. It actually doesn’t look all that small on the phone either…