All the sources codespage 21
Python
May 10, 2016 am31 01:30
#251
""" macro funcion para buscar una imagen independientemente del tipo de
extension que tenga. Habría que comprobar todas las extensiones. De momento
se han puesto las más usadas"""
def buscarFicheroCorrecto(self,id):
flWEB = conf.get_conf( "DOCUMENTGALLERY_WEB_FOLDER" )
flFS = conf.get_conf( "DOCUMENTGALLERY_FS_FOLDER" )
f = None
try:
f = "imagen_%s.gif" % id
logINFO('img', "".join( ( flFS, "/", f )), os.stat( "".join( ( flFS, "/", f ) ) ))
except OSError:
try:
f = "imagen_%s.jpeg" %id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.jpg" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.jpe" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.webp" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.jp2" %id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.jpx" %id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.j2k" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.jxr" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.hdp" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.bmp" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.dib" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.png" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.tiff" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
try:
f = "imagen_%s.tif" % id
os.stat( "".join( ( flFS, "/", f ) ) )
except OSError:
pass
return f
C#
May 09, 2016 am31 01:30
#250
private string HexToInt(string Value)
{
string str;
try
{
str = Value;
}
catch (Exception exception)
{
Trace.Log("Error with HexToInt :");
Trace.LogException(exception);
throw;
}
return str;
}