de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Save webcam captures in different dir
PostPosted: Tue Aug 31, 2021 5:39 pm 
Offline
Addict
User avatar
I am playing with a script inspired by an old CM routine. But I don't want to just import that one, I want to go in a different direction.
One of the things that I want to do, is take pictures with a webcam and store them in a different directory than the default "captured" directory. I also want the pictures to have a name specified by the script so I can easily use them later.

For the life of me, I can't get that to work and I have been looking everywhere, including in other scripts that take webcam pictures. I can take webcam pictures, but they all end up on the "captured" directory with a random name such as "823609430.jpeg"

I am using this code below:
Code:
filename = "images/<scriptname>/captured/01.jpg"
filename = getImage("Taking photo...")
setImage(filename)
new File("images/<scriptname>/captured/01.jpg")


Please tell me what I'm doing wrong and how I can get the script to do what I want.


Top
 Profile Send private message 
 
 Re: Save webcam captures in different dir
PostPosted: Thu Sep 09, 2021 3:18 pm 
Offline
Site Admin
User avatar
You're not far from a good solution. here is what I would do (not tried myself) :
Code:
def filename2 = getDataFolder+"/images/<scriptname>/captured/01.jpg"
def filename1 = getImage("Taking photo...")
def file1 = new File(filename1)
file1.renameTo(filename2)


Top
 Profile Send private message 
 
 Re: Save webcam captures in different dir
PostPosted: Sat Sep 25, 2021 12:17 am 
Offline
Addict
User avatar
Thank you for that tip, Doti!
I think I've got it to work now. :)


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.