Skip to content

Commit

Permalink
Update image format
Browse files Browse the repository at this point in the history
  • Loading branch information
breithbarbot committed Dec 4, 2016
1 parent c248fcf commit 315c94b
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 39 deletions.
Binary file modified .sources/PSD - Projects.psd
Binary file not shown.
4 changes: 2 additions & 2 deletions .sources/config.ini → .sources/config.ini.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;Project : The project name
;Created on : 2016/10/16
;Created at : 2016/10/16
;Author : Breith Barbot

[infos_base]
Expand All @@ -10,7 +10,7 @@ title = ""
description = ""

;URLDEV = "http://dev.website.com"
URLDEV = "http://localhost/www/Project-manager-XAMPP-Web"
URLDEV = ""

;URLPROD = "http://website.com"
URLPROD = ""
Expand Down
47 changes: 24 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Page d'accueil listant tout vos projets XAMPP / Web
![Project-manager XAMPP / Web](.sources/Project-manager_XAMPP_Web.png "Project-manager XAMPP / Web")

Ce projet utilise :
* [Bootstrap](http://getbootstrap.com/)
* [Modernizr](https://modernizr.com/)
* [jQuery](http://jquery.com/)
* [Screen](https://github.com/microweber/screen/)
* [Bootstrap](http://getbootstrap.com)
* [Modernizr](https://modernizr.com)
* [jQuery](http://jquery.com)
* [Screen](https://github.com/microweber/screen)

<br>

Expand All @@ -21,24 +21,25 @@ Ce projet utilise :

4. Un fichier de configuration `/www/YOUR_PROJECT/.sources/config.ini` peut être construit pour chaque projet (FACULTATIF).

;Project : The project name
;Created on : YYYY/MM/DD
;Author : Author name
[infos_base]
title = "The project name"
description = "Project description..."
URLDEV = "http://dev.website.com"
URLPROD = "http://website.com"
URLDB = "http://localhost/phpmyadmin/index.php?db=dbname"
thumbnail = "http://website.com/about"

5. Pour ajouter une image personnalisée à chaque projet, il faut créer une image (en 400px x 250px) et la placer dans le dossier `/www/YOUR_PROJECT/.sources/` et la nommer `picture.png` au format **.png** (FACULTATIF).

;Project : The project name
;Created at : YYYY/MM/DD
;Author : Author name

[infos_base]
title = "The project name"

description = "Project description..."

URLDEV = "http://dev.website.com"

URLPROD = "http://website.com"

URLDB = "http://localhost/phpmyadmin/index.php?db=dbname"

thumbnail = "http://website.com/about"

5. Pour ajouter une image personnalisée à chaque projet, il faut créer une image (en 400px x 250px) et la placer dans le dossier `/www/YOUR_PROJECT/.sources/` et la nommer `picture.jpg` au format **.jpg** (FACULTATIF).

<br>

Expand All @@ -56,7 +57,7 @@ Project-manager XAMPP / Web 2.1

MIT License

Copyright (c) 2016 Breith Barbot | [Breithbarbot.name](https://breithbarbot.name/)
Copyright (c) 2016 Breith Barbot | [Breithbarbot.name](https://breithbarbot.name)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file added assets/img/default.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/default.png
Binary file not shown.
23 changes: 9 additions & 14 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,10 @@ function generateThumbail($url, $fileLocation)
{
$screenCapture = new \Screen\Capture($url);

// $screenCapture->setWidth(1920);
// $screenCapture->setHeight(1080);

$screenCapture->setClipWidth(400);
$screenCapture->setClipHeight(250);

$screenCapture->setBackgroundColor('#565659');
$screenCapture->setImageType('png');

$screenCapture->setWidth(1920);
$screenCapture->setHeight(1200);
$screenCapture->setClipWidth(1920);
$screenCapture->setClipHeight(1200);
$screenCapture->save($fileLocation);

return $screenCapture->getImageLocation();
Expand All @@ -56,7 +51,7 @@ function generateThumbail($url, $fileLocation)

// $html .= (!($i % 4)) ? '<div class="row">' : '';

$picture = (is_file($name_main_folder.$fichier."/.sources/picture.png")) ? $name_main_folder.$fichier."/.sources/picture.png" : "assets/img/default.png";
$picture = (is_file($name_main_folder.$fichier."/.sources/picture.jpg")) ? $name_main_folder.$fichier."/.sources/picture.jpg" : "assets/img/default.jpg";
$urldev = $urlprod = $description = $urldb = "";

if (is_file($name_main_folder.$fichier."/.sources/config.ini")) {
Expand All @@ -67,11 +62,11 @@ function generateThumbail($url, $fileLocation)
$urldb = (!empty($ini_array['infos_base']['URLDB'])) ? $ini_array['infos_base']['URLDB'] : "";
$description = (!empty($ini_array['infos_base']['description'])) ? $ini_array['infos_base']['description'] : "";
// Thumbnail
if (isset($ini_array['infos_base']['thumbnail']) && !is_file($name_main_folder.$fichier."/.sources/picture.png")) {
if (isset($ini_array['infos_base']['thumbnail']) && !is_file($name_main_folder.$fichier."/.sources/picture.jpg")) {
if (!empty($ini_array['infos_base']['thumbnail']) && @get_headers($ini_array['infos_base']['thumbnail'], 1)) {
$picture = generateThumbail($ini_array['infos_base']['thumbnail'], $name_main_folder.$fichier."/.sources/picture.png");
$picture = generateThumbail($ini_array['infos_base']['thumbnail'], $name_main_folder.$fichier."/.sources/picture.jpg");
} else {
$picture = generateThumbail((!empty($urlprod) ? $urlprod : $urldev), $name_main_folder.$fichier."/.sources/picture.png");
$picture = generateThumbail((!empty($urlprod) ? $urlprod : $urldev), $name_main_folder.$fichier."/.sources/picture.jpg");
}
}
} else {
Expand Down Expand Up @@ -103,7 +98,7 @@ function generateThumbail($url, $fileLocation)
$html .= '<div class="bb-project-manager-info-title">'.$title.'</div>';
if (!empty($description)) {
$points = (strlen(trim($description)) > 39) ? '...' : '';
$html .= '<div class="bb-project-manager-info-desc" title="'.$description.'">'.substr(trim($description), 0, 39).$points.'</div>';
$html .= '<div class="bb-project-manager-info-desc" title="'.$description.'">'.trim(substr($description, 0, 39)).$points.'</div>';
}
$html .= '</div>';
$html .= '</div>';
Expand Down
Binary file added www/demo/.sources/picture.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed www/demo/.sources/picture.png
Binary file not shown.

0 comments on commit 315c94b

Please sign in to comment.