slideshow/images/scaledimage.go
2023-11-16 15:26:24 +01:00

32 lines
651 B
Go

package images
// import (
// "math/rand"
// )
// // struct for scaled images
// type scaledImage struct {
// Name string
// Data []byte
// }
// // get a random image
// func getRandomImage() string {
// return images[rand.Intn(len(images)-1)]
// }
// // check if the scaled image is already cached
// func (scaledImage *scaledImage) isCached() bool {
// return isCached(scaledImage.Name)
// }
// // check (by name) if the scaled image is already cached
// func isCached(scaledImageName string) bool {
// for _, cachedImage := range cache {
// if cachedImage.Name == scaledImageName {
// return true
// }
// }
// return false
// }