Jump to content
Xander

Webpage Thumbnail ( Chrome App )

Recommended Posts

Am tot cautat zilele astea un serviciu cu care sa faci thumb-uri la pagini... sa arate corect si sa fie moka :) bineinteles ca nu am gasit asa ca mi-am facut singur

http://ls0.me/screenshots/Webpage Thumbnailer.crx

Install: downloadezi de pe link-ul de mai sus( o sa apara un warning ) , deschizi tools->extensions , tragi extensia peste fereastra , apesi ok

Use: o sa apara in dreapta barii de navigare un aparat foto..., cand te uiti la o pagina apesi pe ala si iti face poza care o sa apara intr-un notification box

Pozele sunt generate de browser , uploadate pe server la mine , scaled la dimensiunea 212x107px si salvate singurele date salvate de server sunt hash('256' , 'url-screenshot') si continutul thumb-ului

codul php care salveaza thumb-urile:


<?php
Header("Content-Type: application/json");
if($_SERVER['REQUEST_METHOD'] != "POST") die();
if(!isset($_POST['img']) || !isset($_POST['url'])) die();
if(!preg_match('#data\:image/png\;base64\,#' , $_POST['img'])) die();
$data = substr($_POST['img'] , 22);
$url = $_POST['url'];
$url = hash('sha256' , $url) . ".png";;
$location = "/thumbs/" . $url;
if(!is_file("." . $location ))
{
$data = base64_decode($data);
$im = new Imagick();
$im->readimageblob($data);
$im->resizeImage(212,107 , 0 , 1 , true);
file_put_contents("." . $location , $im->getImageBlob());
}
$server = "http://ls0.me/screenshots";
echo json_encode(array("location" => $server . $location));
?>

daca cineva are nevoie de codul extensiei in sine si imi da un motiv bunicel pentru el ... il dau moka :)

exemple de poze:

0dddfa0f4ad1fd07ab3cb997f80aefba39260ca0fd4a1e0dd2c011f73758b804.png

5fa6fffe9e6bc0e38846d17ece28fd6c991857e209154b33900d48eb42c9d052.png

50b4a18f1c895176cd4b348e0f3bde7a68e93613adb3558affe854538941f088.png

46169c9feab2a09d40f084563c056809127e6e020ab8896c3daac6a694b399f9.png

d940a5c7374225f56e9a9f02e615ff1a97ef938cd56d9f65be605ea6c1f9b053.png

08f93e8970ac91dd3cf39455ff3488347cc1a65162cfdb03f45fb6d397e289fc.png

P.S.: pentru ca sunt generate direct din browser pozele... nu sunt probleme cu flash-ul :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...