• Home (current)
  • वर्तमान निदेशक => /bin/X11/
  • सूचना एवं अपलोड
    Info Server
Indian Cyber Force
Folders रचयन्तु सञ्चिकां रचयन्तु RansomWeb लॉगआउट
Current File : //bin/X11/pnmindex
#!/bin/bash
#
# pnmindex - build a visual index of a bunch of anymaps
#
# Copyright (C) 1991 by Jef Poskanzer.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.  This software is provided "as is" without express or
# implied warranty.

size=100        # make the images about this big
across=6        # show this many images per row
colors=256      # quantize results to this many colors
back="-white"   # default background color
doquant=true    # quantize or not
title=""        # default title (none)

usage ()
{
  echo "usage: $0 [-size N] [-across N] [-colors N] [-black] pnmfile ..."
  exit 1
}

while :; do
    case "$1" in

    -s*)
        if [ $# -lt 2 ]; then usage; fi
        size="$2"
        shift
        shift
    ;;

    -a*)
        if [ $# -lt 2 ]; then usage; fi
        across="$2"
        shift
        shift
    ;;

    -t*)
        if [ $# -lt 2 ]; then usage; fi
        title="$2"
        shift
        shift
    ;;

    -c*)
        if [ $# -lt 2 ]; then usage; fi
        colors="$2"
        shift
        shift
    ;;

    -b*)
        back="-black"
        shift
    ;;

    -w*)
        back="-white"
        shift
    ;;

    -noq*)
        doquant=false
        shift
    ;;

    -q*)
        doquant=true
        shift
    ;;

    -*)
        usage
    ;;

    *)
        break
    ;;
    esac
done

if [ $# -eq 0 ]; then
    usage
fi

tmpdir=$(mktemp -d -t pi.XXXXXXXX) || exit 1 #219019
tmpfile=$tmpdir/pi.tmp
maxformat=PBM

rowfiles=()
imagefiles=()
row=1
col=1

if [ "$title"x != ""x ] ; then
#    rowfile=`tempfile -p pirow -m 600`
    rowfile=$tmpdir/pi.${row}
    pbmtext "$title" > $rowfile
    rowfiles=(${rowfiles[*]} $rowfile )
    row=$(($row + 1))
fi

for i in "$@"; do

    cp "$i" $tmpfile
    description=(`pnmfile $tmpfile`)

    format=${description[1]}
    width=${description[3]}
    height=${description[5]}

    if [ $? -ne 0 ]; then
        echo pnmfile returned an error
        exit $?
    fi

    if [ $width -gt $size ] || \
       [ $height -gt $size ]; then
        case $format in

        PBM) 
            pnmscale -quiet -xysize $size $size $i | pgmtopbm > $tmpfile
        ;;

        PGM)
            pnmscale -quiet -xysize $size $size $i > $tmpfile
            if [ $maxformat = PBM ]; then
                maxformat=PGM
            fi
        ;;

        *) 
            if [ "$doquant" = "true" ] ; then
                pnmscale -quiet -xysize $size $size $i | \
                ppmquant -quiet $colors > $tmpfile
            else
                pnmscale -quiet -xysize $size $size $i > $tmpfile
            fi
            maxformat=PPM
        ;;
        esac
    fi

    imagefile=$tmpdir/pi.${row}.${col}
    rm -f $imagefile
    if [ "$back" = "-white" ]; then
        pbmtext "$i" | pnmcat $back -tb $tmpfile - > $imagefile
    else
        pbmtext "$i" | pnminvert | pnmcat $back -tb $tmpfile - > $imagefile
    fi
    rm -f $tmpfile
    imagefiles=( ${imagefiles[*]} $imagefile )

    if [ $col -ge $across ]; then
        rowfile=$tmpdir/pi.${row}
        rm -f $rowfile

        if [ $maxformat != PPM -o "$doquant" = "false" ]; then
            pnmcat $back -lr -jbottom ${imagefiles[*]} > $rowfile
        else
            pnmcat $back -lr -jbottom ${imagefiles[*]} | \
            ppmquant -quiet $colors > $rowfile
        fi

        rm -f ${imagefiles[*]}
        unset imagefiles
        imagefiles=()
        rowfiles=( ${rowfiles[*]} $rowfile )
        col=1
        row=$(($row + 1))
    else
        col=$(($col + 1))
    fi
done

# All the full rows have been put in row files.  
# Now put the final partial row in its row file.

if [ ${#imagefiles[*]} -gt 0 ]; then
    rowfile=$tmpdir/pi.${row}
    rm -f $rowfile
    if [ $maxformat != PPM -o "$doquant" = "false" ]; then
        pnmcat $back -lr -jbottom ${imagefiles[*]} > $rowfile
    else
        pnmcat $back -lr -jbottom ${imagefiles[*]} | \
        ppmquant -quiet $colors > $rowfile
    fi
    rm -f ${imagefiles[*]}
    rowfiles=( ${rowfiles[*]} $rowfile )
fi

if [ ${#rowfiles[*]} -eq 1 ]; then
    cat $rowfiles
else
    if [ $maxformat != PPM -o "$doquant" = "false" ]; then
        pnmcat $back -tb ${rowfiles[*]}
    else
        pnmcat $back -tb ${rowfiles[*]} | ppmquant -quiet $colors
    fi
fi
rm -f ${rowfiles[*]}

if [ -d "$tmpdir" ]; then
    rm -rf "$tmpdir";
fi

exit 0

Frontend Submission – Verilere bak
Menu
  • Top 10

Verilere bak

Follow us
  • facebook
  • twitter
Search
Login
Create
Menu

Verilere bak

Login

You are here:

  1. Home
  2. Frontend Submission

Frontend Submission

  • Story

    Mix text with images and embeds

  • Image

    JPG, PNG or GIF

  • Audio

    MP3 or SoundCloud embed, MixCloud, etc.

  • Video

    MP4 or YouTube embed, Vimeo, Dailymotion, etc.

  • Gallery

    A collection of images

  • Embed

    Facebook post, Twitter status, etc.

  • Link

    External site's link

  • Open list

    Everyone can submit new list items and vote up for the best submission

  • Ranked list

    Everyone can vote up for the best list item

  • Classic list

    A list-based article

  • Meme

    Create a funny pic

  • Trivia quiz

    What do you know about ...?

  • Personality quiz

    What type of person are you?

  • Poll

    One or multiple questions about a subject or person

  • Versus

    A poll where each question has two competing answers

  • Hot or Not

    A poll where each question has two opposite answers

Bir yanıt yazın Yanıtı iptal et

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

  • facebook
  • twitter

© 2017 bring the pixel. Remember to change this

  • Home
  • Contact us
Back to Top
Close
  • Top 10
  • Home
  • Animals
  • Funny
  • WOW
  • WTF
  • Features
  • facebook
  • twitter
Create

Log In

Sign In

Forgot password?

Forgot password?

Enter your account data and we will send you a link to reset your password.

Back to Login

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Accept

Add to Collection

  • Public collection title

  • Private collection title

No Collections

Here you'll find all collections you've created before.

Close
of

Processing files…

Hey Friend!
Before You Go…

Get the best viral stories straight into your inbox before everyone else!

Don't worry, we don't spam

Close

Newsletter

Don’t miss out on new posts!

Don't worry, we don't spam

Close