Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ permdir/
node_modules/
package-lock.json
data

.idea/
.vscode/
74 changes: 40 additions & 34 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
# R

Upload file service with react. It's [P](https://github.com/qingfeng/p)'s (react + es6+) version

Douban Intra Service http://r.dapps.douban.com/

# Demo

The [R Demo](https://vast-brushlands-4477.herokuapp.com) showcases `r`.

# Get Started

```shell
git clone https://github.com/dongweiming/r
cd r
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
mkdir permdir
./setup_databases.sh
python app.py
open http://localhost:5000
```

# Command Line

Example:

* Command line: ``curl -F file=@"/tmp/1.png" http://p.dapps.douban.com/``
* Command line: ``curl -F file=@"/tmp/1.png" -F w=100 -F h=100 http://p.dapps.douban.com/``
* Resize image: ``http://p.dapps.douban.com/r/img_hash.jpg?w=300&h=200``
* Affine Transformation:
``http://p.dapps.douban.com/a/img_hash.jpg?w=300&h=300&a=0.86,0.5,-100,-0.5,0.86,50``
(Rotate 30 degree clockwise and then translation 100 right, 50 up.)
# R

Upload file service with react. It's [P](https://github.com/qingfeng/p)'s (react + es6+) version

Douban Intra Service http://r.dapps.douban.com/

# Demo

The [R Demo](https://vast-brushlands-4477.herokuapp.com) showcases `r`.

# Get Started

```shell
git clone https://github.com/dongweiming/r
cd r
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
mkdir permdir
./setup_databases.sh
python app.py
open http://localhost:5000
```

# Command Line

Example:

- Command line: `curl -F file=@"/tmp/1.png" http://p.dapps.douban.com/`
- Command line: `curl -F file=@"/tmp/1.png" -F w=100 -F h=100 http://p.dapps.douban.com/`
- Resize image: `http://p.dapps.douban.com/r/img_hash.jpg?w=300&h=200`
- Affine Transformation:
`http://p.dapps.douban.com/a/img_hash.jpg?w=300&h=300&a=0.86,0.5,-100,-0.5,0.86,50`
(Rotate 30 degree clockwise and then translation 100 right, 50 up.)

# FAQ

## Problems importing magic on Windows 64-bit

Drop the [dlls](https://github.com/pidydx/libmagicwin64) to `C:\Windows\System32` and python magic will import correctly.
Loading