Lee Chambers's picture

Hi,

On the most recent release of Invoice Ninja it will not allow a company logo to be uploaded.

Comes up with "There was a problem reading the image file, please try a different format."

I have tried uploading different formats and also the correct size according to Invoice Ninja website but no success.

Im not a linux genius but looking at the folder permissions they are 0775 which seems to be correct, im now at a loss, please help

Lee

Forum: 
Lee Chambers's picture

Still no success with this 

Jeremy Davis's picture

Thanks for reporting the issue.

Normally I'd also ask for the explicit version (e.g. v16.0), but in this case it doesn't matter as there is only one.

Regarding the issue, a bit of googling suggests that can be caused by the PHP GD extension not being installed. And sure enough, it's not installed, so perhaps that's the issue?

To install, please run the following (if not root, prefix all lines with 'sudo'):

apt update
apt install php-gd
systemctl restart apache2
Lee Chambers's picture

hi, Jeremy 

I will give this a try and report back i did read something about php-gd, but wasnt aware of what it was, i presumed it would of been included.

Thank you 

Jeremy Davis's picture

It's been a little while since I built Invoice Ninja, but I don't recall reading anything about it being a requirement. Regardless, if it's required for the base functionality, then it should be pre-installed. As this appears to be a bug, I've opened an issue so we can fix it in the next release.

FWIW on closer inspection, I note that there are a couple of other PHP extensions which may be dependencies, and aren't included by default. Namely: "php-xml" & "php-mbstring". Regardless I suggest that you install them too (even if they aren't strictly required, they won't hurt). They can be added to the instructions I posted above - at end of the line that includes 'php-gd'. Alternatively, they can be installed separately/after:

apt update
apt install php-xml php-mbstring
systemctl restart apache2
FWIW, my memory is a little vague now, but when I was working on Invoice Ninja v16.0, I was initially intending to install v5. They have been working on v5 for a while which is a full rewrite, however it's still in beta and apparently is not quite feature complete. So I went with v4. The docs for v5 are really good, but the v4 docs are somewhat vague about PHP dependencies (beyond the actual PHP versions supported) and it was hard to find precise info on the required PHP extensions for Invoice Ninja v4.

Anyway, hopefully that fixes it up. Please do not hesitate to post back if you have any further issues/questions.

Lee Chambers's picture

that was indeed the answer thank you for your help Jeremy, Turnkey is fantastic when you know how to use it lol :)

Jeremy Davis's picture

It's definately a bug then, so thanks to you fro reporting it and extra points for confirming the fix! :)

As I noted in my previous reply (and the bug report I've now opened), that it seems likely that there are some other deps missing too. If you haven't already, I suggest that you install them too. If you don't do that now and you hit any other weird issues, then I suggest installing those 2 additional packages as a first step and see if that fixes the issue.

Lee Chambers's picture

As it stands i have only installed the php-gd and spent most of yeasterday experimenting with it all and upto now less the other 2 dependencies, it seems to be working really well, to the point im going to start using this for my personal work, please dont drop this build lol.

Now this maybe quite obvious to some but, if anyone finds themselves struggling setting it up to work with the mobile app follow this guide.

Login to Webmin as root and navigate to Tools>Filemanager.
Expand folders var>www>invoiceninja
Right click on the .env file and choose edit.
Add in at the bottom of the page API_SECRET=password
**Replace password with your secret key of your choice
Click the save disk icon top right of the screen

You will now be able to use the secret you entered in the .env file on the mobile app

The linux gurus will possibly have a much easier way of doing this but as im just getting to grips with linux i found this way quite painless :) 

Jeremy Davis's picture

Thanks for this additional info. Not only will it help others using the current TurnKey Invoice Ninja applaince, but it's something that I'll look to add in to future TurnKey releases.

Add new comment