Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images not showing in offline mode #96

Closed
jerdog opened this issue Aug 10, 2017 · 13 comments
Closed

Images not showing in offline mode #96

jerdog opened this issue Aug 10, 2017 · 13 comments

Comments

@jerdog
Copy link

jerdog commented Aug 10, 2017

When I add an image to a slide, I am using:
![Logo](images/opensource_logo.png)

Which works when viewing online. But when I download and attempt to view it locally
python -m http.server

It displays the alt-text (in this case "Logo") instead of the image. It's trying to pull it from http://localhost:8000/assets/opensource_logo.png which in the offline.zip is relative to the pitchme.md file in the /md/assets/ folder and the file is there... All very strange

@gitpitch
Copy link
Owner

Hi @jerdog can you please point me at your presentation repo so I can try reproduce and investigate the issue you have reported. Thanks.

@jerdog
Copy link
Author

jerdog commented Aug 10, 2017

@gitpitch
Copy link
Owner

Ok, so I just took your sample presentation offline. Based on thePITCHME.md source I see just two images in use. When opened under a local HTTP server I see both of them, as shown here:

img-one

img-two

You can see both are shown Offline in the bottom-right corner of the slideshow window.

Given this, I do not appear to be able to reproduce the problem you have reported here. So a few further questions for you:

  1. Which of the two images is not showing up in your offline presentation?
  2. What operating system are you using locally to open your presentation?
  3. What if any errors are showing up in your developer console for your presentation?

@gitpitch
Copy link
Owner

@jerdog as a side note, the size of your second image is not a perfect fit for the slideshow aspect ratio so you might want to consider using the Image Sizing and Scaling feature to have that rendered more nicely on the slide.

For example, replace your original markdown:

+++
![OSD](images/opensource_definition.png)

---

With this:

+++?image=images/opensource_definition.png&size=auto 90%

---

Not required of course, but it may render more nicely for you when you are using a tall-and-narrow image to fill a wide-and-short slide as in this case.

@jerdog
Copy link
Author

jerdog commented Aug 10, 2017

  1. Neither are showing in offline
  2. Ubuntu Gnome 17.04
  3. No real valuable errors (Firefox and Chrome both say the file is not found for the images)

I am using the python 3 http.server - what about you?

And yeah - was planning on making that image a slide image

@gitpitch
Copy link
Owner

My testing has been on OSX. I have tried both Python 2.7.x and Python 3 HTTP servers using:

python -m SimpleHttpServer

and

python3 -m http.server

respectively.

In both cases, both of your images were rendered without any problems.

@gitpitch
Copy link
Owner

@jerdog if you haven't already you might want to verify that the image assets are available on disk as the expected location and loadable by your HTTP server. The expected URLs are as follows:

http://localhost:8000/assets/md/assets/opensource_definition.png
http://localhost:8000/assets/md/assets/opensource_logo.png

Both of these URLs should open and display the respective images in your browser. And if they don't, we have new clues to investigate.

@jerdog
Copy link
Author

jerdog commented Aug 10, 2017

Yeah - they open with direct links - but they don't open in offline gitpitch for me.

When you look at the code output, it is showing the following locations:
http://localhost:8000/assets/opensource_logo.png
http://localhost:8000/images/opensource_definition.png

@gitpitch
Copy link
Owner

@jerdog can you put the PITCHME.zip bundle that you generated taking your presentation offline somewhere public so I can download exactly what you are looking at.

Also, can you please try download the bundle again and verify that the latest bundle is also exhibiting the problems you described. I asked for this having noted above that the offline bundle I have tested here has worked perfectly.

@jerdog
Copy link
Author

jerdog commented Aug 10, 2017

So I feel stupid... Just removed my local and recreated it from the offline and now it works. No idea what happened/changed/etc. Thanks for your patience.

My guess is it had something to do with multiple changes made to my presentation/code between when I downloaded the original offline copy and when I was just attempting to copy in my changed PITCHME.md file

@jerdog jerdog closed this as completed Aug 10, 2017
@gitpitch
Copy link
Owner

No problem @jerdog just glad to hear you are back up and running with your GitPitch presentation. If you have any further questions don't be afraid to get in touch.

@dbuteau
Copy link

dbuteau commented Dec 7, 2019

Hello i've encountered the same problem and find out why.
When you change the docker port, for example -p 80:9000 (or in the case of jerdog :8000)
The slide appear but the app continue to include the default port :9000 in the images urls so they don't appear on the slide.
restarting the docker with the default port 9000 fix the problem.

@gitpitch
Copy link
Owner

gitpitch commented Dec 7, 2019

@dbuteau this issue thread is for an old offline feature that is no longer supported. I know you are using GitPitch Desktop. To set a custom port for the Desktop you need to make two changes on your launch command:

  1. Update the -p port mapping and
  2. Add a matching PORT environment variable

For example:

docker run -it -v {WORKINGDIR}:/repo -p 80:80 -e PORT=80 gitpitch/desktop:pro

See the Desktop FAQ for details. The documented steps should solve your problem. Let me know how it goes. Cheers, David.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants