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


Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Images
PostPosted: Thu Mar 26, 2015 6:22 pm 
Offline
Veteran
User avatar
I have 2 questions that I can't see the answer for...

If I'm displaying an image taken from a webcam, it typically takes up a lot of the screen. Is there a way to display it making it a different size, e.g. 30% of the screen width with setImage()?.

Also was curious if there is a delete function for sendImage() to remove an image from the server? The communications API is still a bit new so may just not have it in the docs yet?

Thanks

_________________
Liz

You can't take something off the Internet - it's like taking pee out of a pool.
https://play-clan.site profile: Liz


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Thu Mar 26, 2015 6:42 pm 
Offline
Site Admin
User avatar
The image taken with the webcam should be as close from 800px width as possible, so generaly no more than 1024px width. You're right it may be a problem however.
On the server, there is a picture reduction for very big (bytes) pictures.

There's no deletion of picture for now ; it should not be a problem, as you need to know the code (if you save the code, you can also save the picture). On the opposite, there's no backup (unlike other data) against vandalism.


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Wed May 20, 2015 10:46 am 
Offline
Veteran
User avatar
Liz wrote:
If I'm displaying an image taken from a webcam, it typically takes up a lot of the screen. Is there a way to display it making it a different size, e.g. 30% of the screen width with setImage()?.


Think I cracked it, written a quick function so I can display the webcam image at 50% (Thanks Wololo for the advanced example) will make better later:

Code:
def setImageSize = { picture, psize ->
  if (picture == null) {
    setImage(null)
    return
  }
  def image = java.awt.Toolkit.getDefaultToolkit().getImage("images/"+picture)
  def width = image.getWidth()
  def height = image.getHeight()
   
  def frameBuffer = new java.awt.image.BufferedImage( (int)((width*psize)/10), (int)((height*psize)/10),java.awt.image.BufferedImage.TYPE_4BYTE_ABGR)
  def sprite = javax.imageio.ImageIO.read(new File("images/"+picture))
  java.awt.Graphics2D graphics = frameBuffer.createGraphics()
  graphics.drawImage(sprite, 0, 0, (int)((width*psize)/10), (int)((height*psize)/10), null)
  setImage(frameBuffer, false)
}


And in my test, calling it
Code:
setImageSize(TempImg,5)
all worked fine. The problem I get is copying it into the subcontrol_control script. It stops with the "Error java.lang.RuntimeException: Deprecated". This appears to be caused by having the setInfos(6... instead of setInfos(4..

So Doti is there a better way to do this that ver 6 likes or can I disable the error message as the script uses functions from API 6 so am not wanting to set the setInfos to 4?

_________________
Liz

You can't take something off the Internet - it's like taking pee out of a pool.
https://play-clan.site profile: Liz


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Thu May 21, 2015 10:06 am 
Offline
Site Admin
User avatar
Yes ; it is related to Android release (no AWT).

You should provide a byte[] to setImage instead (setImage(byte[] array,int useless) ). It will used as this :
Code:
... new ImageIcon(byteArrayYouSent) ...


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Thu May 21, 2015 11:12 am 
Offline
Veteran
User avatar
Quote:
You should provide a byte[] to setImage instead (setImage(byte[] array,int useless) ).


Sorry, not a programmer and totally thrown by that :oops: , so for the example above do I cast (if thats the right name) frameBuffer to an array of byte making the last line something like:
Code:
setImage((byte[])frameBuffer, 0)


Not that the above works :roll: or should I be be defining the frameBuffer differently.. ..not feeling too clever today :(

_________________
Liz

You can't take something off the Internet - it's like taking pee out of a pool.
https://play-clan.site profile: Liz


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Thu May 21, 2015 11:35 am 
Offline
Site Admin
User avatar
Approx. :
Code:
def frameBuffer = new java.awt.image.BufferedImage(...
...
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream()
javax.imageio.ImageIO.write(frameBuffer, "jpg", baos)
setImage(baos.toByteArray(),0)


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Thu May 21, 2015 11:45 am 
Offline
Veteran
User avatar
Thanks, that does the trick :-)

_________________
Liz

You can't take something off the Internet - it's like taking pee out of a pool.
https://play-clan.site profile: Liz


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Wed May 27, 2015 11:13 pm 
Offline
Veteran
User avatar
So for people reading this.. look at subcontrol_control for an example of it being used. Also note the second to last line of the function should read "png" not "jpg" to work on Linux.

_________________
Liz

You can't take something off the Internet - it's like taking pee out of a pool.
https://play-clan.site profile: Liz


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Mon Aug 17, 2015 2:15 pm 
Offline
Site Admin
User avatar
Notice (Android) : when in scripts using some additional java functions to open a file, I recommand from now set the path to an absolute folder explicitely, with this expression : System.getProperty("user.dir").

That is, from :
Code:
def image = java.awt.Toolkit.getDefaultToolkit().getImage("images/"+picture)

To :
Code:
def image = java.awt.Toolkit.getDefaultToolkit().getImage(System.getProperty("user.dir")+"/images/"+picture)


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Fri May 14, 2021 7:24 am 
Offline
Regular
doti wrote:
There's no deletion of picture for now ; it should not be a problem, as you need to know the code (if you save the code, you can also save the picture). On the opposite, there's no backup (unlike other data) against vandalism.

When will such an option be added?
I think it is important for user data privacy purposes:
Once a script has deleted the image code for an image, there is no way anymore for anyone to retrieve that image via a script, but there is also no way anymore for the script author or for the site admin to tell which image came from which user. So, if a user, who is a resident of the EU, asks for all his images to be deleted, then the site must obey such a request to conform with EU-laws, but as it has no way to know which images might belong to the user, it can't do so, except for deleting the images of ALL users that are stored in the database.

So I think that scripts should have the ability to delete all images that they no longer track i.e. via a deleteImage(string code) function.


Top
 Profile Send private message 
 
 Re: Images
PostPosted: Tue May 18, 2021 1:44 pm 
Offline
Site Admin
User avatar
The unused picture are automatically reduced then deleted after a few weeks.

You are not supposed to put your real identity anywhere when you are using SexScripts. If you are reaching this website from the EU, you may have to refrain from sending any picture of yourself allowing your identification.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 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.