[Trac_gajim-plugins] [Gajim Plugins] #109: Image URL is replaced with the picture
Gajim Plugins
trac at gajim.org
Mon Oct 12 22:40:59 CEST 2015
#109: Image URL is replaced with the picture
---------------------+-----------------------------------
Reporter: rkfg@… | Owner: arune
Type: defect | Status: closed
Priority: minor | Component: UrlImagePreviewPlugin
Resolution: fixed | Keywords:
Blocked By: | Blocking:
---------------------+-----------------------------------
\
\
\
\
\
\
Comment (by rkfg@…):
Fix for helpers.py:
{{{
deadline = time.time() + (10 * max_size / 1048576)
}}}
and
{{{
c.setopt(pycurl.TIMEOUT, 10 * max_size / 1048576)
}}}
Removed the brackets around max_size / 1048576. I had 512 Kb set as max
size so the rest you could figure yourself. Also, errors for exceeding the
deadline and plain socket timeout have the same text which is ambiguous.
I've corrected it for myself like this:
{{{
alt += _('Timeout loading image: deadline')
}}}
and
{{{
alt += _('Timeout loading image: socket timeout')
}}}
Also, this practice of using a meaningful variable (alt text) as an error
text holder is bad but that's for gajim devs to decide. However, if it's
designed as such you could help to locate the source of issues
(url_image_preview.py):
{{{
log.error('Could not download image for URL: %s - %s' % (url, alt))
}}}
Which would show why the image wasn't downloaded (timeout in my case).
\
\
\
--
Ticket URL: <http://trac-plugins.gajim.org/ticket/109#comment:10>
Gajim Plugins <http://trac-plugins.gajim.org/>
Gajim Plugins
More information about the Trac_gajim-plugins
mailing list