Shop Mobile More Submit  Join Login
About Varied / Hobbyist Juan Garbanzo BeanUnknown Recent Activity
Deviant for 10 Years
Needs Core Membership
Statistics 28 Deviations 379 Comments 3,772 Pageviews
×

Newest Deviations

Favourites

Activity


I do my best to credit all the authors of all the vectors. It takes quite a bit of time to make all of those links you see at the bottom of each comic. Lots of copying and pasting and selecting certain bits with the mouse and digging around here and there and blah blah blah. Since I'm doing this for fun, I'd like to minimize the not-fun part as much as possible. I've been meaning to write a script to help with this for a long time.

When I download a vector from DA, I don't rename it. So I have files with names like "obey_pinkie_by_alexiy777-d4w1e8z.png". The file name handily contains enough information to be able to link back to the work on DA if you know the format. I also name all of my photoshop layers after the image that they contain. That means I can create a 'credit line' by analyzing the name of the layers.

I should be able to write a script that takes the 'ID' part (d4w1e8z) and spits out a full credit line, ripe for me to paste in to DA. And indeed I can -- here it is.

import glob
import sys
from os.path import split

def find_file(art_id, mypath='/Users/decoherence/Pictures/'):
    print('searching for {0}**/*{1}*'.format(mypath,art_id))
    result=glob.glob('{0}**/*{1}*'.format(mypath,art_id), recursive=True)
    filename=split(result[0])[-1]
    return(filename)

def get_info(file):
    artist, art_id = file.split('_by_')[-1].split('.')[0].split('-')
    return(artist, art_id)
       
def generate_credit_string(artist,art_id):
    credit_string = ':icon{0}: http://{0}.deviantart.com/gallery/#/{1}'.format(artist, art_id)
    return(credit_string)

if __name__ == '__main__':
    horsefile = find_file(sys.argv[1])
    artist, art_id=get_info(horsefile)
    credit = generate_credit_string(artist, art_id)
    print(credit)

For example:

$ python .\creditor.py d4w1e8z
searching for /Users/decoherence/Pictures/**/*d4w1e8z*
:iconalexiy777: fav.me/d4w1e8z

I just take that last line and paste it in to DA et viola, alexiy777 has a credit!

errr... I realize that shows up as a link, above. I guess that's proof that it works. The real output looks more like this
: iconalexiy777 : ht tp://alexiy777.deviantart.com/gallery/#/d4w1e8z
that's purposefully broken so that it prints. If anyone knows how to keep that from being interpreted by DA's magic parser, let me know!

To further automate it I think I would have to do some kind of Photoshop integration or start organizing pictures differently (like copying or linking them to the project folder for each comic, for instance) but this script cuts down about 80% of the manual labour so it will do for now.
I do my best to credit all the authors of all the vectors. It takes quite a bit of time to make all of those links you see at the bottom of the page. Lots of copying and pasting and selecting certain bits with the mouse and digging around here and there and blah blah blah. Since I'm doing this for fun, I'd like to minimize the not-fun part as much as possible. I've been meaning to write a script to help with this for a long time.

When I download a vector from DA, I don't rename it. So I have files with names like "obey_pinkie_by_alexiy777-d4w1e8z.png". The file name handily contains enough information to be able to link back to the work on DA if you know the format. I also name all of my photoshop layers after the image that they contain. That means I can create a 'credit line' just like I've been doing simply by analyzing the name of the layers.

I should be able to write a script that takes the 'ID' part (d4w1e8z) and spits out a full credit line, ripe for me to paste in to DA. And indeed I can -- here it is.

import glob
import sys
from os.path import split

def find_file(art_id, mypath='/Users/decoherence/Pictures/'):
    print('searching for {0}**/*{1}*'.format(mypath,art_id))
    result=glob.glob('{0}**/*{1}*'.format(mypath,art_id), recursive=True)
    filename=split(result[0])[-1]
    return(filename)

def get_info(file):
    artist, art_id = file.split('_by_')[-1].split('.')[0].split('-')
    return(artist, art_id)
       
def generate_credit_string(artist,art_id):
    credit_string = ':icon{0}: http://{0}.deviantart.com/gallery/#/{1}'.format(artist, art_id)
    return(credit_string)

if __name__ == '__main__':
    horsefile = find_file(sys.argv[1])
    artist, art_id=get_info(horsefile)
    credit = generate_credit_string(artist, art_id)
    print(credit)

For example:

$ python .\creditor.py d51k173
searching for /Users/decoherence/Pictures/**/*d51k173*
:iconvoaxmasterspydre: fav.me/d51k173

I just take that last line and paste it in to DA and viola, voaxmasterspydre has a credit!

To further automate it I think I would have to do some kind of Photoshop integration or start organizing pictures differently (like copying or linking them to the project folder for each comic, for instance) but this script cuts down about 80% of the manual labour so it will do for now.
I do my best to credit all the authors of all the vectors. It takes quite a bit of time to make all of those links you see at the bottom of each comic. Lots of copying and pasting and selecting certain bits with the mouse and digging around here and there and blah blah blah. Since I'm doing this for fun, I'd like to minimize the not-fun part as much as possible. I've been meaning to write a script to help with this for a long time.

When I download a vector from DA, I don't rename it. So I have files with names like "obey_pinkie_by_alexiy777-d4w1e8z.png". The file name handily contains enough information to be able to link back to the work on DA if you know the format. I also name all of my photoshop layers after the image that they contain. That means I can create a 'credit line' by analyzing the name of the layers.

I should be able to write a script that takes the 'ID' part (d4w1e8z) and spits out a full credit line, ripe for me to paste in to DA. And indeed I can -- here it is.

import glob
import sys
from os.path import split

def find_file(art_id, mypath='/Users/decoherence/Pictures/'):
    print('searching for {0}**/*{1}*'.format(mypath,art_id))
    result=glob.glob('{0}**/*{1}*'.format(mypath,art_id), recursive=True)
    filename=split(result[0])[-1]
    return(filename)

def get_info(file):
    artist, art_id = file.split('_by_')[-1].split('.')[0].split('-')
    return(artist, art_id)
       
def generate_credit_string(artist,art_id):
    credit_string = ':icon{0}: http://{0}.deviantart.com/gallery/#/{1}'.format(artist, art_id)
    return(credit_string)

if __name__ == '__main__':
    horsefile = find_file(sys.argv[1])
    artist, art_id=get_info(horsefile)
    credit = generate_credit_string(artist, art_id)
    print(credit)

For example:

$ python .\creditor.py d4w1e8z
searching for /Users/decoherence/Pictures/**/*d4w1e8z*
:iconalexiy777: fav.me/d4w1e8z

I just take that last line and paste it in to DA et viola, alexiy777 has a credit!

errr... I realize that shows up as a link, above. I guess that's proof that it works. The real output looks more like this
: iconalexiy777 : ht tp://alexiy777.deviantart.com/gallery/#/d4w1e8z
that's purposefully broken so that it prints. If anyone knows how to keep that from being interpreted by DA's magic parser, let me know!

To further automate it I think I would have to do some kind of Photoshop integration or start organizing pictures differently (like copying or linking them to the project folder for each comic, for instance) but this script cuts down about 80% of the manual labour so it will do for now.

deviantID

decoherence's Profile Picture
decoherence
Juan Garbanzo Bean
Artist | Hobbyist | Varied
Hazardous biological material!
Interests

Comments


Add a Comment:
 
:iconyayayayayala:
yayayayayala Featured By Owner Sep 17, 2012
OMG YOUR COMIC IS HYSTERICAL!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reply
:icondecoherence:
decoherence Featured By Owner Sep 19, 2012  Hobbyist General Artist
awe, thank you! i wish i could spend more time on it but work has me travelling for the rest of the month. it'll pick up again soon!
Reply
:iconyayayayayala:
yayayayayala Featured By Owner Sep 20, 2012
yay! :D
Reply
:icongcrebel:
Gcrebel Featured By Owner Aug 20, 2012  Hobbyist Digital Artist
haha keep up the good work, i always get a good laugh outta your comics
Reply
:icondecoherence:
decoherence Featured By Owner Aug 20, 2012  Hobbyist General Artist
Awe that's so nice of you to say! I'm glad. ^^;;
Reply
:iconstoephu:
stoephu Featured By Owner Aug 13, 2012
YOu just got a watch, because your comics are quite funny and the idea is good^^
Reply
:icondecoherence:
decoherence Featured By Owner Aug 13, 2012  Hobbyist General Artist
That's very kind of you to say, thanks! I'll do my best to keep it up!
Reply
:iconabydos91:
abydos91 Featured By Owner Aug 1, 2012  Hobbyist Digital Artist
Thanks for the watch :D
Reply
:icondecoherence:
decoherence Featured By Owner Aug 3, 2012  Hobbyist General Artist
The pleasure is all mine :)
Reply
:iconabydos91:
abydos91 Featured By Owner Aug 3, 2012  Hobbyist Digital Artist
:iconpinkiepiesmileplz:
Reply
Add a Comment: