Skip to content

Commit

Permalink
Updated dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruces committed Mar 27, 2023
1 parent 7e58c34 commit 185c0e8
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build/app.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleVersion</key>
<string>0.10.5</string>
<string>0.10.7</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions build/versioninfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"Comments": "",
"CompanyName": "Nuno Cruces",
"FileDescription": "",
"FileVersion": "0.10.5.0",
"FileVersion": "0.10.7.0",
"InternalName": "rethinkraw",
"LegalCopyright": "© 2019-2022 Nuno Cruces",
"LegalTrademarks": "",
"OriginalFilename": "RethinkRAW.exe",
"PrivateBuild": "",
"ProductName": "RethinkRAW",
"ProductVersion": "0.10.5",
"ProductVersion": "0.10.7",
"SpecialBuild": ""
},
"VarFileInfo": {
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ go 1.19

require (
github.com/gorilla/schema v1.2.0
github.com/gorilla/websocket v1.5.0
github.com/josephspurrier/goversioninfo v1.4.0
github.com/ncruces/go-exiftool v0.4.0
github.com/ncruces/go-fetch v0.0.0-20201125022143-c61f8921eb46
Expand All @@ -12,22 +13,23 @@ require (
github.com/ncruces/jason v0.4.0
github.com/ncruces/keyless v0.0.0-20230223133947-fcba6242c6a3
github.com/ncruces/zenity v0.10.6
github.com/tetratelabs/wazero v1.0.0-rc.1
golang.org/x/exp v0.0.0-20230304125523-9ff063c70017
golang.org/x/net v0.8.0
github.com/tetratelabs/wazero v1.0.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
golang.org/x/sync v0.1.0
golang.org/x/sys v0.6.0
gonum.org/v1/gonum v0.12.0
)

require (
github.com/akavel/rsrc v0.10.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dchest/jsmin v0.0.0-20220218165748-59f39799265f // indirect
github.com/gabriel-vasile/mimetype v1.4.1 // indirect
github.com/krolaw/zipstream v0.0.0-20180621105154-0a2661891f94 // indirect
github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844 // indirect
github.com/tdewolff/minify/v2 v2.12.4 // indirect
github.com/tdewolff/parse/v2 v2.6.4 // indirect
golang.org/x/image v0.6.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/text v0.8.0 // indirect
)
13 changes: 8 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
github.com/akavel/rsrc v0.10.2 h1:Zxm8V5eI1hW4gGaYsJQUhxpjkENuG91ki8B4zCrvEsw=
github.com/akavel/rsrc v0.10.2/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgkuj+NQRlZcDbAbM1ORAbXjXX77sX7T289U=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
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=
github.com/dchest/jsmin v0.0.0-20220218165748-59f39799265f h1:OGqDDftRTwrvUoL6pOG7rYTmWsTCvyEWFsMjg+HcOaA=
github.com/dchest/jsmin v0.0.0-20220218165748-59f39799265f/go.mod h1:Dv9D0NUlAsaQcGQZa5kc5mqR9ua72SmA8VXi4cd+cBw=
github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE=
Expand All @@ -14,6 +15,8 @@ github.com/gabriel-vasile/mimetype v1.4.1 h1:TRWk7se+TOjCYgRth7+1/OYLNiRNIotknkF
github.com/gabriel-vasile/mimetype v1.4.1/go.mod h1:05Vi0w3Y9c/lNvJOdmIwvrrAhX3rYhfQQCaf9VJcv7M=
github.com/gorilla/schema v1.2.0 h1:YufUaxZYCKGFuAq3c96BOhjgd5nmXiOY9NGzF247Tsc=
github.com/gorilla/schema v1.2.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/josephspurrier/goversioninfo v1.4.0 h1:Puhl12NSHUSALHSuzYwPYQkqa2E1+7SrtAPJorKK0C8=
github.com/josephspurrier/goversioninfo v1.4.0/go.mod h1:JWzv5rKQr+MmW+LvM412ToT/IkYDZjaclF2pKDss8IY=
github.com/krolaw/zipstream v0.0.0-20180621105154-0a2661891f94 h1:+AIlO01SKT9sfWU5CLWi0cfHc7dQwgGz3FhFRzXLoMg=
Expand Down Expand Up @@ -50,14 +53,14 @@ github.com/tdewolff/parse/v2 v2.6.4/go.mod h1:woz0cgbLwFdtbjJu8PIKxhW05KplTFQkOd
github.com/tdewolff/test v1.0.6/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tdewolff/test v1.0.7 h1:8Vs0142DmPFW/bQeHRP3MV19m1gvndjUb1sn8yy74LM=
github.com/tdewolff/test v1.0.7/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/tetratelabs/wazero v1.0.0-rc.1 h1:ytecMV5Ue0BwezjKh/cM5yv1Mo49ep2R2snSsQUyToc=
github.com/tetratelabs/wazero v1.0.0-rc.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ=
github.com/tetratelabs/wazero v1.0.0 h1:sCE9+mjFex95Ki6hdqwvhyF25x5WslADjDKIFU5BXzI=
github.com/tetratelabs/wazero v1.0.0/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20230304125523-9ff063c70017 h1:3Ea9SZLCB0aRIhSEjM+iaGIlzzeDJdpi579El/YIhEE=
golang.org/x/exp v0.0.0-20230304125523-9ff063c70017/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.6.0 h1:bR8b5okrPI3g/gyZakLZHeWxAR8Dn5CyxXv1hLH5g/4=
golang.org/x/image v0.6.0/go.mod h1:MXLdDR43H7cDJq5GEGXEVeeNhPgi+YYEQ2pC1byI1x0=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
Expand Down
3 changes: 2 additions & 1 deletion make.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ IF NOT EXIST %tgt%\utils\exiftool\exiftool.exe (

IF NOT EXIST %tgt%\utils\dcraw.wasm (
ECHO Download dcraw...
SET "url=https://github.com/ncruces/dcraw/releases/download/v9.28.6-wasm/dcraw.wasm.gz"
SET "url=https://github.com/ncruces/dcraw/releases/download/v9.28.7-wasm/dcraw.wasm.gz"
go run github.com/ncruces/go-fetch -unpack !url! %tgt%\utils
COPY /Y %tgt%\utils\dcraw.wasm pkg\dcraw\embed\dcraw.wasm
)

IF NOT EXIST assets\normalize.css (
Expand Down
5 changes: 3 additions & 2 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cp "build/app.plist" "$tgt/Info.plist"
cp "build/icon.icns" "$tgt/Resources/"
cp "build/icon.icns" "$app/droplet.icns"
cp "build/exiftool_config.pl" "$tgt/MacOS/utils"
plutil -replace CFBundleVersion -string "0.10.5" RethinkRAW.app/Contents/Info.plist
plutil -replace CFBundleVersion -string "0.10.7" RethinkRAW.app/Contents/Info.plist
plutil -replace CFBundleDocumentTypes -xml "$(cat build/doctypes.plist)" RethinkRAW.app/Contents/Info.plist
ln -sf "RethinkRAW.app/Contents/MacOS/rethinkraw" "$app/rethinkraw-server"

Expand All @@ -25,8 +25,9 @@ fi

if [ ! -f "$tgt/MacOS/utils/dcraw.wasm" ]; then
echo Download dcraw...
url="https://github.com/ncruces/dcraw/releases/download/v9.28.6-wasm/dcraw.wasm.gz"
url="https://github.com/ncruces/dcraw/releases/download/v9.28.7-wasm/dcraw.wasm.gz"
curl -sL "$url" | gzip -dc > "$tgt/MacOS/utils/dcraw.wasm"
cp "$tgt/MacOS/utils/dcraw.wasm" "pkg/dcraw/embed/dcraw.wasm"
fi

if [ ! -f "assets/normalize.css" ]; then
Expand Down
3 changes: 2 additions & 1 deletion make_wine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ fi

if [ ! -f "$tgt/utils/dcraw.wasm" ]; then
echo Download dcraw...
url="https://github.com/ncruces/dcraw/releases/download/v9.28.6-wasm/dcraw.wasm.gz"
url="https://github.com/ncruces/dcraw/releases/download/v9.28.7-wasm/dcraw.wasm.gz"
curl -sL "$url" | gzip -dc > "$tgt/utils/dcraw.wasm"
cp "$tgt/utils/dcraw.wasm" "pkg/dcraw/embed/dcraw.wasm"
fi

if [ ! -f "assets/normalize.css" ]; then
Expand Down
22 changes: 12 additions & 10 deletions pkg/chrome/chrome.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"bufio"
"bytes"
"errors"
"io"
"io/fs"
"log"
"math/rand"
Expand All @@ -16,8 +15,8 @@ import (
"sync"
"sync/atomic"

"github.com/gorilla/websocket"
"github.com/ncruces/jason"
"golang.org/x/net/websocket"
)

var once sync.Once
Expand Down Expand Up @@ -103,7 +102,7 @@ func (c *Cmd) Start() error {
line := scan.Bytes()
if bytes.HasPrefix(line, []byte(prefix)) {
url := line[len(prefix):]
c.ws, err = websocket.Dial(string(url), "", c.url)
c.ws, _, err = websocket.DefaultDialer.Dial(string(url), nil)
if err != nil {
return err
}
Expand Down Expand Up @@ -131,16 +130,19 @@ func (c *Cmd) Close() error {

func (c *Cmd) receiveloop() {
var started bool
var targets = set[string]{}
targets := set[string]{}
c.send("Target.setDiscoverTargets", "", jason.Object{"discover": true})
for {
var msg cdpMessage
err := websocket.JSON.Receive(c.ws, &msg)
if err == io.EOF {
break
}
err := c.ws.ReadJSON(&msg)
if err != nil {
log.Print("chrome:", err)
if websocket.IsUnexpectedCloseError(err,
websocket.CloseGoingAway,
websocket.CloseNormalClosure,
websocket.CloseAbnormalClosure) {
log.Println("chrome:", err)
}
break
}
switch msg.Method {
case "Target.targetDestroyed", "Target.targetCrashed":
Expand All @@ -163,7 +165,7 @@ func (c *Cmd) receiveloop() {
}

func (c *Cmd) send(method, session string, params any) error {
return websocket.JSON.Send(c.ws, jason.Object{
return c.ws.WriteJSON(jason.Object{
"id": c.msg.Add(1),
"method": method,
"params": params,
Expand Down
5 changes: 1 addition & 4 deletions pkg/dcraw/dcraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"regexp"
"strconv"
"sync"
"sync/atomic"

_ "embed"

Expand All @@ -49,7 +48,6 @@ var (
sem *semaphore.Weighted
orienRegex *regexp.Regexp
thumbRegex *regexp.Regexp
counter atomic.Uint64
)

func compile() {
Expand Down Expand Up @@ -88,8 +86,7 @@ func run(ctx context.Context, root fs.FS, args ...string) ([]byte, error) {

var buf bytes.Buffer
cfg := wazero.NewModuleConfig().
WithArgs(args...).WithStdout(&buf).WithFS(root).
WithName("dcraw-" + strconv.FormatUint(counter.Add(1), 10))
WithArgs(args...).WithStdout(&buf).WithFS(root)
module, err := wasm.InstantiateModule(ctx, module, cfg)
if err != nil {
return nil, err
Expand Down
Binary file modified pkg/dcraw/embed/dcraw.wasm
Binary file not shown.

0 comments on commit 185c0e8

Please sign in to comment.