private void shrink(final String imgName)
	{
		new Thread(new Runnable(){

			@Override
			public void run() {
			
				boolean result=false;
				String errMsg = "";
			    final String input = mConfig.srcImgPath+"\\"+imgName;
			    final String output = mConfig.dstImgPath+"\\"+imgName;
			    
				HttpURLConnection connection=null;
				BufferedReader in=null;
				try {
							String userDir = System.getProperty("user.dir");
							System.setProperty("javax.net.ssl.trustStore", userDir+"\\jssecacerts\\jssecacerts");
							
							
							final String key = mConfig.apiKeys.get(keyRandom.nextInt(mConfig.apiKeys.size()));//
//							final String key = keys[keyRandom.nextInt(keys.length)];//
//						    final String input = "D:\\input.png";
//						    final String output = "D:\\output.png";
		
						    connection = (HttpURLConnection) new URL(API_URL).openConnection();
						    connection.setConnectTimeout(100000);
						    connection.setReadTimeout(100000);
						    String auth = DatatypeConverter.printBase64Binary(("api:" + key).getBytes("UTF-8"));
						    connection.setRequestProperty("Authorization", "Basic " + auth);
						    connection.setDoOutput(true);
		
						    try (OutputStream request = connection.getOutputStream()) 
						    {
						      Files.copy(Paths.get(input), request);
						    }   
		
						    if (connection.getResponseCode() == 201)
						    {
							      // Compression was successful, retrieve output from Location header.
							      final String url = connection.getHeaderFields().get("Location").get(0);
								  connection.disconnect();
								  connection=null;
								    	
							      connection = (HttpURLConnection) new URL(url).openConnection();
							      connection.setConnectTimeout(100000);
							      connection.setReadTimeout(100000);
							      try (InputStream response = connection.getInputStream()) 
							      {
								        Files.copy(response, Paths.get(output), StandardCopyOption.REPLACE_EXISTING);
								        result=true;
								        System.out.println("Compression success.");
							      }
						    } 
						    else
						    {
							      // Something went wrong! You can parse the JSON body for details.
						    	 System.out.println("Compression failed.");
						    	 
							      try (InputStream response = connection.getInputStream()) 
							      {
							    	  	in = new BufferedReader(new InputStreamReader(response));
							            StringBuilder sb = new StringBuilder();
							            String line;
							            while ((line = in.readLine()) != null) 
							            {
							            	sb.append(line);
							            }
							            errMsg=sb.toString();
							      }
						    }

				} catch (Exception e2) {
					e2.printStackTrace();
					result=false;
					errMsg=getThrowableInfo(e2);
					System.out.println("Exception .");
				}finally{
						try {
									if (in != null) {
					                    in.close();
					                }
									if(null!=connection)
									{
										connection.disconnect();
										connection=null;
									}
						} catch (Exception e3) {
							e3.printStackTrace();
						}
				}
				
				mIShrinkResult.onShinkResult(result, imgName,errMsg);
			}
			
		}).start();
		 
	}