From 0f9f32dd49df18805404a598d22830b325bb8b7c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 18 Mar 2014 22:43:12 +0200 Subject: [PATCH] Improved logo in PDF --- README.md | 2 +- app/controllers/AccountController.php | 2 +- app/controllers/InvoiceController.php | 6 ++++++ app/routes.php | 9 ++++++++- app/views/accounts/details.blade.php | 2 +- app/views/header.blade.php | 4 ++++ app/views/invoices/edit.blade.php | 4 ++-- public/js/script.js | 8 ++++---- 8 files changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ad03017fff47..24fa8714447a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Most online invoicing sites are expensive. They shouldn't be. The aim of this project is to provide a free, open-source alternative. Additionally, the hope is the codebase will serve as a sample site for Laravel as well as other JavaScript technologies. -For updates follow [@invoiceninja](https://twitter.com/invoiceninja) and [@hillelcoren](https://twitter.com/hillelcoren) +For updates follow [@invoiceninja](https://twitter.com/invoiceninja) or join the [Facebook Group](https://www.facebook.com/invoiceninja) Site design by [kantorp-wegl.in](http://kantorp-wegl.in/) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index e76a91db5e13..81b69709a058 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -530,7 +530,7 @@ class AccountController extends \BaseController { { $path = Input::file('logo')->getRealPath(); File::delete('logo/' . $account->account_key . '.jpg'); - Image::make($path)->resize(120, 80, true, false)->save('logo/' . $account->account_key . '.jpg'); + Image::make($path)->resize(null, 120, true, false)->save('logo/' . $account->account_key . '.jpg'); } Event::fire('user.refresh'); diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 7d16724aec52..629e6df79e33 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -206,6 +206,12 @@ class InvoiceController extends \BaseController { public static function getViewModel() { + // Temporary fix to let users know to re-upload their logos for higher res + if (Auth::user()->account->getLogoHeight() == 80) + { + Session::flash('warning', "We've increased the logo resolution in the PDF. Please re-upload your logo to take advantage of it."); + } + return [ 'account' => Auth::user()->account, 'products' => Product::scope()->orderBy('id')->get(array('product_key','notes','cost','qty')), diff --git a/app/routes.php b/app/routes.php index a55f6907c064..d8177f4d5b3d 100755 --- a/app/routes.php +++ b/app/routes.php @@ -166,7 +166,13 @@ HTML::macro('breadcrumbs', function() { $str = '