You are not logged in.

#1 2015-10-04 18:55:08

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,381
Website

dropimage (share your scrots from dropbox with thumbnail), a script

Reposting from #! forums due to popular demand

It's a bash script:
https://raw.githubusercontent.com/bront … /dropimage

Usage (dropbox must be running):

dropimage scrot.png

or

dropimage *.png

or full workflow example

dropbox.py start && cd Dropbox/Public && scrot -q 0 -d 9 some.png && dropimage some.png

will generate "invisible" .thumbs (in same directory) and code for pasting into forums (clipboard automagically armed). 

example output:
.some.png

Ideas:
- use mktemp? < done
- add more checks (isImage?, wasThumbGenerated?, whatDoesDropbox.py.Think?) < no.
- perhaps add some sort of 'dropimage scrot' option
- echo html version in terminal (not just linkage, entire html 5 page), but keep forum version in clipboard
- speed: image processing could be done first (before dropbox.py) and in parallel. < low priority

Bugs:
- only working when run in the dir at the moment < fixed.
- images with alpha (with small padding) are not nicely thumbnailed < fixed

Last edited by brontosaurusrex (2015-10-04 20:54:26)

Online

#2 2015-10-09 01:52:33

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: dropimage (share your scrots from dropbox with thumbnail), a script

Hi,

You have

-q 0

in

dropbox.py start && cd Dropbox/Public && scrot -q 0 -d 9 some.png && dropimage some.png

I have scrot version 0.8-13 (on Lubuntu 14.04 LTS) and for that version man scrot says that -q can have values from 1 (lowest quality) to 100 (highest quality).

  -q, --quality NUM
       Image quality (1-100) high value means high  size,  low  compression.
       Default: 75. (Effect differs depending on file format chosen).

Assuming that -q 0 isn't unintended, what purpose does it have in your code?

Edit: I was curious and so I ran scrot with -q 0, -q 1, -q 10, and -q 75

scrot -q  0 36964
scrot -q  1 36824
scrot -q 10 37565
scrot -q 75 68753

So scrot -q 0 works.

Last edited by vasa1 (2015-10-09 04:04:25)


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

#3 2015-10-09 07:12:02

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,381
Website

Re: dropimage (share your scrots from dropbox with thumbnail), a script

@vasa1: In png case -q 0 means max compression (quality is obviously the same, as png is lossless).

Online

#4 2015-10-09 11:45:48

vasa1
Member
Registered: 2015-09-29
Posts: 204

Re: dropimage (share your scrots from dropbox with thumbnail), a script

brontosaurusrex wrote:

@vasa1: In png case -q 0 means max compression (quality is obviously the same, as png is lossless).

Thanks for clarifying. It wasn't clear to me from scrot's man page.


Using the Openbox (3.5.2) session of Lubuntu 14.04 LTS but very interested in BL :)

Offline

Board footer

Powered by FluxBB