Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1011979 // Upload webcam image to Smart Bot's Chat [WORKS, uses JPG]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 6469K of libraries. Click here for Pure Java version (7841L/53K/194K).

!7

p-subst {
  BufferedImage img = cast time(f singleImagePreferablyFromLastWebcam);
  if (img == null) { infoBox("Got no image"); ret; }
  ImageSurface is = showImage("Will upload in 3! Close window to stop this.", img);
  hideConsole();
  sleepSeconds(3);
  if (!is.isShowing()) {
    infoBox("Upload cancelled.");
    ret;
  }
  setFrameTitle(is, "Uploading...");
  S imageURL = uploadJPEGToImageServer(img, "User webcam image");
  print("Image uploaded as " + imageURL);
  setFrameTitle(is, "Posting...");
  if (postToSmartBotsChat("[IMAGE] " + imageURL))
    setFrameTitle(is, print("Posted image to chat!"));
  else
    setFrameTitle(is, print("Could not post image."));
}

Author comment

Began life as a copy of #1009033

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011979
Snippet name: Upload webcam image to Smart Bot's Chat [WORKS, uses JPG]
Eternal ID of this version: #1011979/1
Text MD5: 391f99cb265c88b2844c740c0309a58a
Transpilation MD5: 00e564478c9e7f84ea63c12e14ef43fb
Author: stefan
Category: javax / desktop / camera
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-14 03:42:13
Source code size: 699 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 366 / 480
Referenced in: [show references]