Skip to content

Commit

Permalink
Merge branch 'release/1.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Nov 22, 2024
2 parents 603a7b6 + 3ba2b6a commit 39ba38e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [1.1.6]

- Exclude more resampled files, including converted (webp) and FocusPoint ones when using `--ignore-resampled`
- Workaround for Silverstripe 5 thumbnails when using `--ignore-resampled`
- Update Go dependencies


## [1.1.5]

- Update go-mysqldump (adds support for dumping VIEW tables)
Expand Down
4 changes: 2 additions & 2 deletions app/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ var (
// ResampledRegex regular expressions should match all common thumbnail manipulations except for
// resized images as those tend to be linked from HTMLText and aren't auto-generated without a republish
ResampledRegex = []*regexp.Regexp{
// Silverstripe 4
regexp.MustCompile(`(?i)\_\_(Fit|Fill|Scale|Resampled)([a-z0-9]+)\.(jpg|png|jpeg|tiff)$`),
// Silverstripe 4 and 5
regexp.MustCompile(`(?i)\_\_(Crop|ExtRewrite|Fill|Fit|Focus|Pad|Quality|Resampled|Scale)([a-z0-9_]*)\.[a-z0-9]{1,4}$`),

// Silverstripe 3
regexp.MustCompile(`(?i)\/\_resampled\/(Pad|CMSThumbnail|stripthumbnail|Cropped|Set|Fit|Fill|Scale|Resampled).*\.(jpg|png|jpeg|tiff)`),
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ require (
github.com/go-sql-driver/mysql v1.8.1
github.com/joho/godotenv v1.5.1
github.com/kr/pretty v0.1.0 // indirect
github.com/spf13/cobra v1.8.0
github.com/spf13/cobra v1.8.1
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ github.com/aliakseiz/go-mysqldump v1.1.0 h1:d6Oags6vfY0in9thm8ik94rfMOJg29/AasL5
github.com/aliakseiz/go-mysqldump v1.1.0/go.mod h1:xZRk7AUfKO44O7nywHl3j9OleW2U8HW3ufiPWMS4kiA=
github.com/axllent/semver v0.0.1 h1:QqF+KSGxgj8QZzSXAvKFqjGWE5792ksOnQhludToK8E=
github.com/axllent/semver v0.0.1/go.mod h1:2xSPzvG8n9mRfdtxSvWvfTfQGWfHsMsHO1iZnKATMSc=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -25,8 +25,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
9 changes: 3 additions & 6 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path"
"path/filepath"
"strings"

"github.com/axllent/ssbak/app"
)
Expand Down Expand Up @@ -57,11 +58,6 @@ func CalcSize(path string) (int64, error) {
return size, err
}

// Convert an int64 to uint64
func int64Touint64(val int64) uint64 {
return uint64(val)
}

// ByteToHr returns a human readable size as a string
func ByteToHr(b int64) string {
const unit = 1024
Expand Down Expand Up @@ -125,7 +121,8 @@ func skipResampled(filePath string) bool {
}

for _, r := range app.ResampledRegex {
if r.MatchString(filePath) {
// Silverstripe 5 generates thumbnails for CMS previews by default with `__FitMaxWzM1MiwyNjRd`
if !strings.Contains(filePath, "__FitMaxWzM1MiwyNjRd.") && r.MatchString(filePath) {
return true
}
}
Expand Down

0 comments on commit 39ba38e

Please sign in to comment.