Coder Social home page Coder Social logo

urls to gifs and other formats about imv HOT 2 CLOSED

japrogramer avatar japrogramer commented on August 16, 2024
urls to gifs and other formats

from imv.

Comments (2)

czarkoff avatar czarkoff commented on August 16, 2024

Actually, the main advantage of this program is its filtering capability, which allows to use it in scripts. Eg. one can use a script like this:

#!/bin/sh

IMGDIR="`mktemp -dt imv.XXXXXX`"

for url in "$@"
do
    filename="`echo \"$url\" | sed -E 's,^(.*/)*([^/]+)$,\2,'`"
    curl -so "$IMGDIR/$filename" "$url" && echo "$IMGDIR/$filename"
done | imv - | sort | uniq | xargs rm -f

[ "`ls $IMGDIR`" == "" ] && exec rm -R $IMGDIR

echo "${PS1}ls -1 \"$IMGDIR\""
ls -1 "$IMGDIR"

This script won't load and display files in parallel because imv starts displaying images only after all of the standard input is read. And this is actually something I'd love to see changed, so that imv would hurry to display a file as soon as it learns about it.

from imv.

eXeC64 avatar eXeC64 commented on August 16, 2024

A script like the one above would be the preferred solution.

Letting imv start viewing input files before the input is terminated sounds like it could be quite useful, but would require some thought regarding edge cases.

Viewing a single image without a script will soon be supported too by piping data in with a flag (probably -x): curl http://example.com/image.jpg | imv -x
The work on that's not finished yet though.

from imv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.