InvoiceShelf / docker

InvoiceShelf Docker Image public repository
https://hub.docker.com/r/invoiceshelf/invoiceshelf
14 stars 5 forks source link

Logo/images/emoji not showing up in created invoice & other documents #15

Closed yesbhautik closed 4 months ago

yesbhautik commented 6 months ago

Describe the bug Logo/images/emoji not showing up in created invoice and in other documents

Expected behavior Company logo/images/emoji must be showed and printed in PDF

Screenshots image image

Please complete the following information:

Optional info

Marthaarman commented 5 months ago

Same issue! v1.2.2 docker

joelbduncan commented 5 months ago

Same thing here with the latest docker image, Ubuntu 22.04.

I'm using a NGINX proxy are you two doing the same?

yesbhautik commented 5 months ago

yes same this side... using latest docker image ⏩

kamelohr commented 5 months ago

I was able to fix / workaround it, by adjusting the blade-Template for the respective document:

In the source I replaced {{ $logo }} with {{ "data:".mime_content_type($logo).";base64,".base64_encode(file_get_contents($logo)) }} and now it seems to work.

Got the inspiration for this fix from here.

Also, I noticed that neither the logo nor my avatar image was displayed in the web interface and opening the URL directly resulted in a 404. To fix that, I ran php artisan storage:link inside the docker container which apparently created some symlinks that won't be there from the initial bootup. Unfortunately I'm not that deep into the code to be able to say if those two issues are related or not, but I wanted to mention it in case they are.

Marthaarman commented 5 months ago

I was able to fix / workaround it, by adjusting the blade-Template for the respective document:

In the source I replaced {{ $logo }} with {{ "data:".mime_content_type($logo).";base64,".base64_encode(file_get_contents($logo)) }} and now it seems to work.

Got the inspiration for this fix from here.

Also, I noticed that neither the logo nor my avatar image was displayed in the web interface and opening the URL directly resulted in a 404. To fix that, I ran php artisan storage:link inside the docker container which apparently created some symlinks that won't be there from the initial bootup. Unfortunately I'm not that deep into the code to be able to say if those two issues are related or not, but I wanted to mention it in case they are.

Nice workaround! can you specify which file you actually changed this line of code in?

yesbhautik commented 5 months ago

where is core maintainers? it's not small bug, and facing many peoples. So solution bug manually is not good idea, this repo need official update.

On Wed, Jun 5, 2024, 13:01 Mart @.***> wrote:

I was able to fix / workaround it, by adjusting the blade-Template for the respective document:

In the source I replaced {{ $logo }} with {{ "data:".mime_content_type($logo).";base64,".base64_encode(file_get_contents($logo)) }} and now it seems to work.

Got the inspiration for this fix from here https://stackoverflow.com/a/72436585.

Also, I noticed that neither the logo nor my avatar image was displayed in the web interface and opening the URL directly resulted in a 404. To fix that, I ran php artisan storage:link inside the docker container which apparently created some symlinks that won't be there from the initial bootup. Unfortunately I'm not that deep into the code to be able to say if those two issues are related or not, but I wanted to mention it in case they are.

Nice workaround! can you specify which file you actually changed this line of code in?

— Reply to this email directly, view it on GitHub https://github.com/InvoiceShelf/docker/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIH3M6WCDECGQPOK6ZGZE3ZF25F7AVCNFSM6AAAAABHCQZB5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGA4DEMJTGM . You are receiving this because you authored the thread.Message ID: @.***>

kamelohr commented 5 months ago

Nice workaround! can you specify which file you actually changed this line of code in?

@Marthaarman Sure! I changed it in the blade-Template that can be found inside the docker container at this location: /var/www/html/InvoiceShelf/resources/views/app/pdf/invoice/invoice#.blade.php

mchev commented 5 months ago

It appears the issue might be related to the Docker configuration.

This has been discussed in others threads: https://github.com/InvoiceShelf/docker/issues/7 and https://github.com/InvoiceShelf/docker/issues/5

Running php artisan storage:link should help resolve it.

Here is an example of how to fix the issue while the core team work on the next update:

docker exec -it your_container_name php artisan storage:link

To know the container_name you can run docker ps

Marthaarman commented 5 months ago

It appears the issue might be related to the Docker configuration.

This has been discussed in others threads: InvoiceShelf/docker#7 and InvoiceShelf/docker#5

Running php artisan storage:link should help resolve it.

Here is an example of how to fix the issue while the core team work on the next update:

docker exec -it your_container_name php artisan storage:link

To know the container_name you can run docker ps

unfortunately, it doesn't resolve for me

StuSerious commented 4 months ago

@mchev

Here is an example of how to fix the issue while the core team work on the next update:

docker exec -it your_container_name php artisan storage:link

I tried this after commenting in issue 113, but it throws the following error:

gdarko commented 4 months ago

Hey here - Since those issues are related to the docker image, i am moving it to the Docker repository.

Hoschi1982 commented 4 months ago

I was able to solve the problem by the following fix from @kamelohr

I was able to fix / workaround it, by adjusting the blade-Template for the respective document:

In the source I replaced {{ $logo }} with {{ "data:".mime_content_type($logo).";base64,".base64_encode(file_get_contents($logo)) }} and now it seems to work.

Got the inspiration for this fix from here.

Also, I noticed that neither the logo nor my avatar image was displayed in the web interface and opening the URL directly resulted in a 404. To fix that, I ran php artisan storage:link inside the docker container which apparently created some symlinks that won't be there from the initial bootup. Unfortunately I'm not that deep into the code to be able to say if those two issues are related or not, but I wanted to mention it in case they are.

I also figured out that it must be due to the Docker configuration, as everything worked fine on my local machine. I cloned the Github repositories into a private GIT repository, built them locally and debugged them (on a Windows machine). Everything runs correctly. Then I created my own Docker image and pushed it into a private Docker registry. (original Dockerfile used) After creating a container from this Docker image, the first problem was that the logos were uploaded and saved, but could no longer be displayed in the settings page where the logo was uploaded. I solved this problem by including the following call in the Dockerfile:

php artisan storage:link

After the docker image was rebuilt and a container was created, the logos could be uploaded and displayed again on the settings page. (Here I found out that there is still a bug regarding refresh, but that's not a problem)

The second problem was that the logo was saved, but not displayed in the PDF documents. Here I had tried several variants. The solution was the one described above. (the same problems occurred with the original Docker image as well)

mchev commented 4 months ago

We plan to consolidate the repositories into a single one (InvoiceShelf), which will include the Docker configuration for version 2. This consolidation is expected to simplify project management and centralize all issues in one place. At this stage, we will create a clean configuration (Dockerfile, docker-compose, and nginx conf) to resolve the current image problems.

Since version 2 addresses many ongoing issues, we hope to offer this solution soon.

gdarko commented 4 months ago

Hello there,

We recently reworked the docker images and the updated docker images: :latest, :1.3.0, :nightly, :alpha contain the storage fixes.

Follow the guide to upgrade: https://github.com/InvoiceShelf/docker?tab=readme-ov-file#compose-upgrade

Best Regards, Darko

yesbhautik commented 4 months ago

Hello there,

We recently reworked the docker images and the updated docker images: :latest, :1.3.0, :nightly, :alpha contain the storage fixes.

Follow the guide to upgrade: https://github.com/InvoiceShelf/docker?tab=readme-ov-file#compose-upgrade

Best Regards, Darko

I have redeployed the docker complainer with nightly tag, I am still facing the same issue as before.

gdarko commented 4 months ago

Hey @yesbhautik - Can you try to re-set your logo image?

Also can you provide more details about the emojis, how are you using them? Both images and emojis are separate issues and the issues related to emojis can be unrelated to the one related to images (logo, etc).

yesbhautik commented 4 months ago

I redeployed from Scratch, it is not working at all. We can comrpo with emojis, but atleast logo is mandatory. Else create a template where no logo or images are not showing up.

On Mon, Jul 15, 2024 at 2:23 PM Darko Gjorgjijoski @.***> wrote:

Hey @yesbhautik https://github.com/yesbhautik - Can you try to re-set your logo image? Also can you provide more details about the emojis?

Both images and emojis are separate issues.

— Reply to this email directly, view it on GitHub https://github.com/InvoiceShelf/docker/issues/15#issuecomment-2227999933, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIH3M2V36FVA4YCBD5GB63ZMOEW5AVCNFSM6AAAAABKS7YNKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXHE4TSOJTGM . You are receiving this because you were mentioned.Message ID: @.***>

--

Best Regards, Bhautik Bavadiya https://www.youareunique.co.in/ Founder & CEO

Email: @. Phone: +91 63535 86391 <+916353586391> Organization: YesbhautikX https://www.yesbhautikx.co.in/ [image: GitHub] https://github.com/yesbhautik [image: Twitter] https://www.twitter.com/yesbhautik [image: LinkedIn] https://www.linkedin.com/in/yesbhautik [image: Instagram] https://www.instagram.com/yesbhautik [image: Whatsapp] https://wa.me/916353586391 This e-mail may contain confidential and/or legally privileged information and is meant for the intended recipient only. If you have received this e-mail in error and are not the intended recipient, kindly notify us at @. & @.*** and then delete this e-mail immediately from your system. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail, its contents or its attachment/s other than by its intended recipient is strictly prohibited and may be unlawful.

gdarko commented 4 months ago

I think it's still some leftover from previously that is messing up your storage structure. I have some more suggestions:

  1. Copy docker-compose.mysql.yaml to docker-compose.yaml again and customize it according to your needs and then redeploy it by the guide. Docker compose files changed with most recent docker refactor, so make sure you have the latest one.
  2. Clone the docker repository in other directory and try spinning up a clean install and see if that works.

Which OS you are using?

Best Regards, Darko

yesbhautik commented 4 months ago

I am installing it via EasyPanel with nightly tag -Issue not solved yet. Still tried with dockage docker-compose but here the website is not working.

On Mon, Jul 15, 2024 at 2:36 PM Darko Gjorgjijoski @.***> wrote:

I think it's still some leftover from previously that is messing up your storage structure. I have some more suggestions:

  1. Copy docker-compose.mysql.yaml to docker-compose.yaml again and customize it according to your needs and then redeploy it by following the guide https://github.com/InvoiceShelf/docker?tab=readme-ov-file#compose-upgrade. Docker compose files changed with the recent release, so make sure you have the latest one.
  2. Clone the docker repository in other directory and try spinning up a clean install and see if that works.

Which OS you are using?

Best Regards, Darko

— Reply to this email directly, view it on GitHub https://github.com/InvoiceShelf/docker/issues/15#issuecomment-2228024814, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIH3M4JFNGER5BWYAJBBITZMOGIHAVCNFSM6AAAAABKS7YNKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRYGAZDIOBRGQ . You are receiving this because you were mentioned.Message ID: @.***>

--

Best Regards, Bhautik Bavadiya https://www.youareunique.co.in/ Founder & CEO

Email: @. Phone: +91 63535 86391 <+916353586391> Organization: YesbhautikX https://www.yesbhautikx.co.in/ [image: GitHub] https://github.com/yesbhautik [image: Twitter] https://www.twitter.com/yesbhautik [image: LinkedIn] https://www.linkedin.com/in/yesbhautik [image: Instagram] https://www.instagram.com/yesbhautik [image: Whatsapp] https://wa.me/916353586391 This e-mail may contain confidential and/or legally privileged information and is meant for the intended recipient only. If you have received this e-mail in error and are not the intended recipient, kindly notify us at @. & @.*** and then delete this e-mail immediately from your system. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail, its contents or its attachment/s other than by its intended recipient is strictly prohibited and may be unlawful.

gdarko commented 4 months ago

Hey, I will check EasyPanel and see if i can do anything.

yesbhautik commented 4 months ago

ya sure, I will be very helpful.

If you don’t wanna deploy easypanel then let me give you direct access to my server. It will be very easy for you. Before Easypanel needs fresh server instance/VPS.

On Mon, Jul 15, 2024 at 2:44 PM Darko Gjorgjijoski @.***> wrote:

Hey, I will check EasyPanel and see if i can do anything.

— Reply to this email directly, view it on GitHub https://github.com/InvoiceShelf/docker/issues/15#issuecomment-2228039389, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIH3M5NS6UNYGQTNOOFFZ3ZMOHGTAVCNFSM6AAAAABKS7YNKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRYGAZTSMZYHE . You are receiving this because you were mentioned.Message ID: @.***>

--

Best Regards, Bhautik Bavadiya https://www.youareunique.co.in/ Founder & CEO

Email: @. Phone: +91 63535 86391 <+916353586391> Organization: YesbhautikX https://www.yesbhautikx.co.in/ [image: GitHub] https://github.com/yesbhautik [image: Twitter] https://www.twitter.com/yesbhautik [image: LinkedIn] https://www.linkedin.com/in/yesbhautik [image: Instagram] https://www.instagram.com/yesbhautik [image: Whatsapp] https://wa.me/916353586391 This e-mail may contain confidential and/or legally privileged information and is meant for the intended recipient only. If you have received this e-mail in error and are not the intended recipient, kindly notify us at @. & @.*** and then delete this e-mail immediately from your system. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail, its contents or its attachment/s other than by its intended recipient is strictly prohibited and may be unlawful.

azaricstefan commented 4 months ago

I have non-docker environment and logo was not loading. For me it was not loading until I changed invoice blade file to this:

INVOICE BLADE PHP
.....

<td class="text-center">
                    @if ($logo)
                            <?php
                            function fetchBase64Image($url, $disableSSL = false) {
                                if ($disableSSL) {
                                    $context = stream_context_create([
                                        'ssl' => [
                                            'verify_peer' => false,
                                            'verify_peer_name' => false,
                                        ],
                                    ]);
                                    $data = file_get_contents($url, false, $context);
                                } else {
                                    $data = file_get_contents($url);
                                }
                                $type = pathinfo($url, PATHINFO_EXTENSION);
                                return 'data:image/' . $type . ';base64,' . base64_encode($data);
                            }

                            if (filter_var($logo, FILTER_VALIDATE_URL)) {
                                // Disable SSL verification for local or development environment
                                $disableSSL = app()->environment(['local', 'development']);
                                $base64 = fetchBase64Image($logo, $disableSSL);
                            } else {
                                // If $logo is a local file path
                                $path = public_path($logo);
                                $type = pathinfo($path, PATHINFO_EXTENSION);
                                $data = file_get_contents($path);
                                $base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
                            }
                            ?>
                        <img class="header-logo" style="height:50px"
                             src="{{ $base64 }}"
                             alt="Logo">
                    @else
                        @if ($invoice->customer->company)
                            <h2 class="header-logo"> {{ $invoice->customer->company->name }}</h2>
                        @endif
                    @endif
                </td>
....
INVOICE BLADE PHP

Note: I disable SSL check for development environment.

zcraber commented 2 months ago

Experiencing the same issue. Tried uploading JPG, PNG and SVG.

image

MuratDoganer commented 2 months ago

Hi, im on a clean fresh install and seeing this issue as well. I am on the latest version (1.30)

stomko11 commented 1 month ago

I am facing the same issue. Is there at least workaround that could help? I have tried workaround described here: https://github.com/InvoiceShelf/InvoiceShelf/issues/125 but it does not work for me, getting Error 500 after.