RE: Show Part Picture (if available) Issue
I recently noticed pictures showed correctly for Work Order entry so I had a look at the code for showing pictures for each page.
Two comments:
#1: Adding "$SupportedImgExt = array('png','jpg','jpeg');" on line 861 in SelectProducts.php fixed the issue.
#2: The code to manage images here is a bit different and could likely be made more consistent if not the same.
In an effort to be more consistent I chose to change the code at line 861 to match that found elsewhere in webERP:
$SupportedImgExt = array('png','jpg','jpeg');
$imagefile = reset((glob($_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.{' . implode(",", $SupportedImgExt) . '}', GLOB_BRACE)));
if(extension_loaded('gd') && function_exists('gd_info') && file_exists ($imagefile) ) {
$StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'.
'&StockID='.urlencode($myrow['stockid']).
'&text='. //$myrow['stockid'] .
'&width=100'.
'&height=100'.
'" alt="" />';
} else if(file_exists ($imagefile)) {
$StockImgLink = '<img src="' . $imagefile . '" height="100" width="100" />';
} else {
$StockImgLink = '<p>'._('No Image').'</p>';
}
https://www.linkedin.com/in/eclipsepaulbecker
|