This topic is locked

4000px Image thumbnail not showing

3/12/2017 1:33:03 AM
PHPRunner General questions
D
daipayan author

Hello,
I had created an application where I need to upload 3000px or more dimension images. Same is getting uploaded but thumbnail view not showing any images.
Also, the thumbnail section showing blank but if I click on blank section, full image showing in popup.
Can you help?
Here is screenshot link

1# Thumbnail blank


2# After clicking full image showing


3# PHPInfo




PLEASE GUIDE

HJB 3/12/2017

Binary field: Image
To create thumbnails on the fly, select the Create thumbnails of the fly check box and choose the field name to save thumbnails in.
Note: you need an additional binary field (field of MEDIUMBLOB type) to store thumbnails. This field is the auxiliary one and we do not recommend to display it on your pages. You can display/hide fields on the Choose fields page.
Unquote excerpt ex https://xlinesoft.com/phprunner/docs/edit_as_settings_file_image.htm
From the screenshots seen, it's more than obvious that you ran your own design ideas here rather than to simply make use of what is already a built-in feature of world's best RAD tool ever seen on this plant.

admin 3/13/2017

As a first step make sure that thumbnails are actually created. Maybe PHP limit memory needs to be increased in php.ini so it can handle images like this.

S
steveh 3/16/2017

I'm not sure whether this is related to your issue, but there is a bug with thumbnails, in that the routine getNotListBlobFieldsIndices() removes all blob fields that are not displayed on the list screen, however it doesn't check that a thumbnail is being used and removed the thumbnail and leaves the main image field.
The ViewDatabaseImage.php expects the thumbnail field to be in the $data array which it isn't at that point having been previously removed.
I've just fixed it in my copy, Ill ping a patch to xlinesoft later.
Steve

D
daipayan author 3/19/2017

Can you please provide me the patch?



I'm not sure whether this is related to your issue, but there is a bug with thumbnails, in that the routine getNotListBlobFieldsIndices() removes all blob fields that are not displayed on the list screen, however it doesn't check that a thumbnail is being used and removed the thumbnail and leaves the main image field.
The ViewDatabaseImage.php expects the thumbnail field to be in the $data array which it isn't at that point having been previously removed.
I've just fixed it in my copy, Ill ping a patch to xlinesoft later.
Steve

D
daipayan author 3/19/2017

Can you please provide me the patch?



I'm not sure whether this is related to your issue, but there is a bug with thumbnails, in that the routine getNotListBlobFieldsIndices() removes all blob fields that are not displayed on the list screen, however it doesn't check that a thumbnail is being used and removed the thumbnail and leaves the main image field.
The ViewDatabaseImage.php expects the thumbnail field to be in the $data array which it isn't at that point having been previously removed.
I've just fixed it in my copy, Ill ping a patch to xlinesoft later.
Steve

D
daipayan author 3/20/2017

Can you please provide me the patch?



I'm not sure whether this is related to your issue, but there is a bug with thumbnails, in that the routine getNotListBlobFieldsIndices() removes all blob fields that are not displayed on the list screen, however it doesn't check that a thumbnail is being used and removed the thumbnail and leaves the main image field.
The ViewDatabaseImage.php expects the thumbnail field to be in the $data array which it isn't at that point having been previously removed.
I've just fixed it in my copy, Ill ping a patch to xlinesoft later.
Steve

S
steveh 3/21/2017

I'll post it here when I get to the office tomorrow.

S
steveh 3/22/2017

Firstly, please take copies of both these files as you will need to restore them if you have a bug you want to report to xlinesoft, please do not report issues to them with these modifications in place.
Here's a replacement routine for phpfunctions.php which leaves the thumbnail fields in if used.

/**

* Get indices of the not list page's blob fields

* @return Array

* #1243 issue with removing thumbnails that we should be removing.

*/

public function getNotListBlobFieldsIndices()

{

$allFields = $this->pSet->getFieldsList();

$blobIndices = $this->pSet->getBinaryFieldsIndices();



// #1236

// Build an array of field->thumbnail field

$thumbnailFields=array();

foreach($blobIndices as $idx)

{

$fieldName = $allFields[ $idx - 1 ];

if( $this->pSet->appearOnListPage($fieldName) && $this->pSet->showThumbnail($fieldName) ) {

$thumbnailFields[$fieldName]=$this->pSet->getStrThumbnail($fieldName);

}

}





$indices = array();

foreach($blobIndices as $idx)

{

$fieldName = $allFields[ $idx - 1 ];

// #1236

// If we're on the list but using a thumbnail then add us to the list,

// if we're not in the list and we're not a thumbnail then add us

$appearOnListPage = $this->pSet->appearOnListPage( $fieldName );

if( (!$appearOnListPage && !in_array($fieldName,$thumbnailFields)) ||

($appearOnListPage && array_key_exists($fieldName,$thumbnailFields)) ) {

$indices[] = $idx;

}

}



return $indices;

}


========= replacement routine for ViewDatabaseImageField.php ==========================

public function showDBValue(&$data, $keylink)

{

// #1236 only return blank if we are using this field and not a thumbnail

if( !$this->showThumbnails && !$data[ $this->field ] ) {

return "";

}



$value = "";

$fileName = 'file.jpg';

$fileNameF = $this->container->pSet->getFilenameField($this->field);

if( $fileNameF && $data[$fileNameF] )

$fileName = $data[$fileNameF];



if( $this->showThumbnails )

{

$thumbPref = $this->container->pSet->getStrThumbnail($this->field);

// #1236 same shortcut as above

if(!$data[ $thumbPref ]) {

return "";

}

$hrefBegin = GetTableLink("mfhandler", "", "filename=".$fileName."&table=".rawurlencode($this->container->pSet->_table));

$hrefEnd = "&nodisp=1&pageType=".$this->container->pageType.$keylink."&rndVal=".rand(0,32768);



$linkClass = "zoombox";

if( $this->thumbWidth && $this->thumbHeight )

{

$hasThumbnail = $thumbPref != "" && strlen($data[ $thumbPref ]);

$thumbFileUrl = $hrefBegin."&field=".( $hasThumbnail ? rawurlencode($thumbPref) : rawurlencode($this->field) ).$hrefEnd;

$smallThumbnailStyle = $this->getSmallThumbnailStyle( $thumbFileUrl, $hasThumbnail );

$linkClass.= " background-picture";

}



$value.= "<a target=_blank href='".$hrefBegin."&field=".rawurlencode($this->field).$hrefEnd."' class='".$linkClass."' ".$smallThumbnailStyle.">";



$value.= "<img border=0";

if($this->is508)

$value.= " alt=\"Image from DB\"";

$value.= " src='".$hrefBegin."&field=".rawurlencode($thumbPref).$hrefEnd."'>";



$value.= "</a>";

}

else

{

$value = "<img";

if($this->is508)

$value.= " alt=\"Image from DB\"";





$value.= " border=0";

$value.= $this->getImageSizeStyle(true)." src='".GetTableLink("mfhandler", "", "filename=".$fileName."&table=".rawurlencode($this->container->pSet->_table)

."&field=".rawurlencode($this->field)

."&nodisp=1"

."&pageType=".$this->container->pageType.$keylink."&rndVal=".rand(0,32768))."'>";

}

return $value;

}