Opened 6 years ago

Closed 2 years ago

#8331 closed defect (fixed)

Images can't be found

Reported by: AllenB Owned by: rjollos
Priority: normal Component: CodeExampleMacro
Severity: normal Keywords:
Cc: rjollos Trac Release: 0.12


I am running Trac 0.12 and whenever I try to load a wiki page containing a CodeExample macro, I get "404 Not Found" errors in the Trac log for button-expand.gif, etc. Also, when viewing the WikiMacros page, the section showing details for the [[CodeExample]] macro shows broken links in place of the sample screenshots.

I discovered that the images in the htdocs/img directory aren't being included in the egg. I made the following change to to partially address this problem. Change the lines

package_data={'codeexample': ['templates/*.html', 'htdocs/css/*.css',


package_data={'codeexample': ['templates/*.html', 'htdocs/css/*.css',
                                  'htdocs/js/*.js', 'htdocs/img/*.gif', 'htdocs/img/*.png']},

and the "404 Not Found" errors on the .gif files will no longer be seen. Manually inspecting the egg cache confirms that the .gif and .png images are now being included in the egg file as expected.

However, I am still seeing bad image links being generated on the WikiMacros page. The bad image URL that is generated looks like when the desired image is instead located at

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by rjollos

  • Cc rjollos added; anonymous removed

comment:2 Changed 5 years ago by ilewismsl

The problem with the WikiMacros page display comes from the double slashes in the Image() macro invocations.

For example:


should be


That is, the path should be environment relative, not server relative.

For all but Example4, I recommend replacing the image with the actual macro invocation. It gives the user a real example, not just a dummy one.

Example4 needs an image or include no example display since it is designed to access a repository and it cannot know where to find anything on any given system.

comment:3 Changed 3 years ago by rjollos

  • Owner changed from nuald to rjollos
  • Status changed from new to assigned

comment:4 Changed 2 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

In 14039:

1.2: Include images in egg and fixed links to sample screenshots. Fixes #8331.

Thanks to AllenB and ilewismsl for the patches.

Add Comment

Modify Ticket

as closed The owner will remain rjollos.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.