opened
odedniv
username_0
This also fixes not setting directory at all (in order to replace original),
it currently doesn't have a `/` between the `dirname` and `basename`.
Support relative directory and backup original
issue
created
ysugimoto
username_1
- Original image will stored at uploaded directory. Would you save to other bucket / directory?
- When supporting relative directory like `./`, we also should be supported parent directory like `../` . It must resolve absolute path, and check that relative target is a root directory.
comment
created
odedniv
username_0
* Not sure I understand. I wanted to reduce the file in place, but keep the original file as a backup. My config looks something like this:

```json
{
  "backup": {
    "directory": "./original"
  },
  "reduce": {
    "quality": 20
  }
}
```

Note that I'm not setting the directory for `reduce`. Before my changes there was also a bug that in that case if the key was `x/y.jpg` it would save the reduced file at `xy.jpg` (missing a `/`).

* That makes kinda makes sense, though I can't really think of a use case. Do you know a JSON function for merging paths?
comment
created
odedniv
username_0
@username_1 just found this: https://nodejs.org/api/path.html#path_path_join_paths

Do you want me to create another pull request?
comment