smalling image size

can anybody help me? i am doing this project http://makezine.com/projects/notifying-doorbell-with-pushingbox/ but i cannot open the image. it said that can only be sent 100kb size but the camera sent 300kb image. where can i fixed it?

#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>

////
//
// General code from http://www.pushingbox.com for Arduino + Ethernet Shield (official) v1.2
//
////

#include <SPI.h>
#include <Ethernet.h>

  /////////////////
 // MODIFY HERE //
/////////////////
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x19 };   // Be sure this address is unique in your network

//Your secret DevID from PushingBox.com. You can use multiple DevID  on multiple Pin if you want
char DEVID1[] = "v765E69EFC8351E8";        //Scenario : "The mailbox is open"

//Numeric Pin where you connect your switch
uint8_t pinDevid1 = 3; // Example : the mailbox switch is connect to the Pin 3

// Debug mode
boolean DEBUG = true;
  //////////////
 //   End    //
//////////////


char serverName[] = "api.pushingbox.com";
boolean pinDevid1State = false;                // Save the last state of the Pin for DEVID1
boolean lastConnected = false;                 // State of the connection last time through the main loop


// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
  Serial.begin(300);
  pinMode(pinDevid1, INPUT);
  
  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    while(true);
  }
  else{
    Serial.println("Ethernet ready");
    // print the Ethernet board/shield's IP address:
    Serial.print("My IP address: ");
    Serial.println(Ethernet.localIP());
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
}

void loop()
{
      ////
      // Listening for the pinDevid1 state
      ////
      if (digitalRead(pinDevid1) == HIGH && pinDevid1State == false) // switch on pinDevid1 is ON 
      {
        if(DEBUG){Serial.println("pinDevid1 is HIGH");}
        pinDevid1State = true;
        //Sending request to PushingBox when the pin is HIGH
        sendToPushingBox(DEVID1);
      }
       if (digitalRead(pinDevid1) == LOW && pinDevid1State == true) // switch on pinDevid1 is OFF
      {
        if(DEBUG){Serial.println("pinDevid1 is LOW");}
        pinDevid1State = false;
        //Sending request to PushingBox when the pin is LOW
        //sendToPushingBox(DEVID1);    //Here you can run an other scenario by creating a DEVID2 variable
      }
      
      
      //DEBUG part
      // this write the respons from PushingBox Server.
      // You should see a "200 OK"
      if (client.available()) {
        char c = client.read();
        if(DEBUG){Serial.print(c);}
      }
      
      // if there's no net connection, but there was one last time
      // through the loop, then stop the client:
      if (!client.connected() && lastConnected) {
        if(DEBUG){Serial.println();}
        if(DEBUG){Serial.println("disconnecting.");}
        client.stop();
      }
      lastConnected = client.connected();
}


//Function for sending the request to PushingBox
void sendToPushingBox(char devid[]){
  client.stop();
  if(DEBUG){Serial.println("connecting...");}

  if (client.connect(serverName, 80)) {
    if(DEBUG){Serial.println("connected");}

    if(DEBUG){Serial.println("sendind request");}
    client.print("GET /pushingbox?devid=");
    client.print(devid);
    client.println(" HTTP/1.1");
    client.print("Host: ");
    client.println(serverName);
    client.println("User-Agent: Arduino");
    client.println();
  } 
  else {
    if(DEBUG){Serial.println("connection failed");}
  }
}

Use paint or some other picture editor to re size it.

zehhayusoff96:
can anybody help me? i am doing this project http://makezine.com/projects/notifying-doorbell-with-pushingbox/ but i cannot open the image. it said that can only be sent 100kb size but the camera sent 300kb image. where can i fixed it?

//Your secret DevID from PushingBox.com. You can use multiple DevID  on multiple Pin if you want

char DEVID1 = “v765E69EFC8351E8”;        //Scenario : “The mailbox is open”

In future, you may not want to leave things like this in the open.

But anyway,

The camera needs to format the image to 100kB or less. Either find some sort of firmware update you can do/change settings of the camera, buy a camera that will produce the 100kB images, or accept the 300kB image, buy a Raspberry Pi and set that up to e-mail you rather than this odd API system thing.

Using fswebcam and a bash script, this becomes a pretty sleek solution?

PS> Mutt can attach files to e-mails sent in bash:

echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- recipient@domain.com

And finally, python is the native raspberry pi programming language. Very easy to get it to detect a button press and then run a bash script:

I usually use imglarger.com to increase or decrease the size of the image, but before I was using Paint and it worked just as good. To tell the truth, by using Paint you get lower quality while using imglarger the quality remains the same. If you don't mind that, then Paint is the quicker option, but if you care about the quality try this online service. I use it very often because I'm constantly uploading content on certain forums and websites, and many of them don't accept images that exceed a specific size, but this works in other cases just as good.

For Windoze, the "Goto" is IrfanView.