TYPO3 not showing images in front end - regular content elements and ext:news - typo3-7.6.x

We've just moved a Typo3 v7.6.30 Website to a new server and although the Website has started up and working as expected, when we try to upload images to content pages, they aren't displayed. When we turn debugging on, we can see that the media item has been loaded, but the 'type' property, which we would expect to be set to '2' is set to zero. Other meta data properties such as height, width and MIME type are also unset. So this explains why the image is not rendering in the template.
When we look at the 'sys_file_processedfile' table in the database, we can see that record for a 'preview' image has been created but no record for the processed image for the front end. Also, the record for the image in the 'sys_file_metadata' doesn't have any properties set.
We have run the 'Convert image formats to jpg' test in the Install too and everything shows as okay. Our 'Image Handling Settings' are set to 'Image Magick version 6 or higher' and the following options have been set in the configuration: -
[GFX][image_processing] = 1
[GFX][thumbnails] = 1
[GFX][thumbnails_png]
[GFX][gif_compress] = 1
[GFX][imagefile_ext] = gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pd
[GFX][gdlib] = 0
[GFX][gdlib_png] = 0
[GFX][im] = 1
[GFX][im_path] = /usr/bin/
[GFX][im_path_lzw] = /usr/bin/
[GFX][im_version_5] = im6
[GFX][im_v5effects] = 1
[GFX][im_mask_temp_ext_gif] = 1
[GFX][im_noScaleUp] = 0
[GFX][im_noFramePrepended] = 0
[GFX][im_stripProfileCommand] = +profile '*'
[GFX][im_useStripProfileByDefault] = 1
[GFX][jpg_quality] = 65
[GFX][png_truecolor] = 1
[GFX][colorspace] = sRGB
Has any one else come across this issue before? It looks as if the properties for the Processed images aren't being brought through to the front end or written to the database.
Thanks very much

If you copy an installation you might have amismatch between files in filesystem and all Information about these files in TYPO3.
Updating the storage index could show unresolved sys_file records or index other files in place of the original.
Also the metadata might fail, especially if ext:filemetadata is not installed.
Furthermore the processed images:
Some possibilities:
all images in the FE are correct, but the orignal is missing and any resizing of the images results in boken images (the hash-values for processed images and the processed images are correct, the original is missing or the sys_file record is missing)
all processed images are broken. TYPO3 has records about all processed images, but the images do not exist in filesystem. (remove all temporary images in install-tool: the records are deleted and records and images are build anew)
the folder for processed images can not be written. Normaly TYPO3 then uses the original image, which is not possible if the image has been cropped.

Bernd, thank you for your response.
We fixed the issue, php-fileinfo was not enabled on the new host. Strangely this was not detected by the install tool environment checker.
Thanks again.
Tom

Related

Displaying multiple images from scene7 image set on category image

I have taken over a site and am looking for some assistance.
The site currently detects if a product has a scene7 image set associated to it, and then adds IS to the code to display the image set.
I am trying to do this for category image as well, if I hardcode _IS (product sku + _ID) the image set is loaded nicely, but obviously any product sku with no image set, the image doesn't load.
This is the code with the _IS hardcoded:
flyoutViewer.setAsset("/${catalogEntryDetails.partNumber}_IS");
This snippet of code detects whether there is a set or not:
var asset = '/' + wc.render.getContextById('ItemDetailsContext').properties.partNumber;
if (data['catalogRecord.exists'] == 1) {
asset += 'IS';
}
Am I missing something major? My guess I am, I can dig out more code if necessary.
Help would be appreciated?!

Magento 1.7 - Product Import - Images do not load

I have been trying to import products into Magento and images. The products are being imported and created properly but the images to not get imported.
I am aware of the basics of importing as I have done it in the past but cannot figure out what the issue is and what to do next.
some notes how and what I did:
I am aware to add a "/" before the image name
image name is case sensitive
upload images in media/import folder
media folder to be 777
Tried different folders like var/import or
media/catalog/product/import
Removed the .htcaccess file in media
Flushed cache
when i upload manually an image on a product it does show up properly
i tried specifying the _media_attribute_id in a column as 88 maybe
that should help but it didn't
If you have a Mage_Catalog_Model_Product, all you need to do is this:
$fn = '/absolute/path/to/image.jpg';
$types = array('thumbnail', 'small_image', 'image'); // or null if you already have the product's thumbnail, small image, and image set
$move = true; // move the source file, don't leave it sitting around
$exclude = false; // enabled in product view
$label = 'Turquoise';
$product->addImageToMediaGallery($fn, $types, $move, $exclude); // Strictly speaking, only the first parameter is required
if(!empty($label)) {
$gallery = $product->getData('media_gallery');
$gallery_img = array_pop($gallery);
$gallery_img['label'] = $label;
array_push($gallery['images'], $gallery_img);
$product->setData('media_gallery', $gallery);
}
$product->save();
I have faced the same problem while uploading product image. And i tested many methods to figure that out. But nothing helped me. At last in one of the tutorial I have seen that the image name and the sku name has to be same. with the extension of file extension. So i followed it and by God's grace it worked. You may try that also. It worked for me. I had spent almost one full day to figure that out.

check if image exists on asset host and if not replace with a default image

So I am having this issue with ruby, the following code explains what is going on
def image_full(img,options)
    if Jjdowns::Application.assets.find_asset("#{img}").nil?
      image_full = image_tag("#{img}",options)
    else
      image_full = image_tag("app/no-image-large.png", options)
    end
  end
What i am trying to do is run a check if an image exists on my asset server then if it exists show the original image. If there is no image found on the asset server then i want to show a default image.
This code block works for showing the image but the part about showing the default image does not function.
So far my research has turned up nothing in the way of a solution to this issue.
Just to clarify the asset server is a in house "CDN" server and the default image is located on the asset server.
The solution to the problem ended up being the following
def some_image(img,options)
    default_img = "dir_to_image/no-image-filler.png"
    if ("#{img}") != ''
      default_img = "#{img}"
    end
    some_image = image_tag(default_img, options)   
end
The key thing here was that we have an external asset host running on a separate server, and that was the initial problem.

using coldfusion 8 to add images to rows in an excel document

Using Coldfusion 8 has anyone been able to either embed images into a excel spreadsheet (xlsx) or link them via img src?
Some background info: The cf server will pickup an excel document with product rows. Based on the product id and style etc, I be able to find or create an image that gets added as the first column into the existing excel doc.
I know coldfusion 9 has a function called SpreadsheetAddImage, unfortunately I'm on cf 8 with no chance to upgrade.
I am not sure what you are currently using to manipulate the xlsx files. However, the spreadsheet functionality in CF9 utilizes POI, which can obviously be used from CF8 as well. It just requires a little more low level code.
Pre-requisites:
Though POI is bundled with CF8, it is an old version. You need a newer version to manipulate .xlsx files. You can either use the javaLoader -OR- replace the existing jars in {cf_root}\lib folder. Note, I do not know if replacing the jars has any negative side effects.
Adding Images:
Excel does not really support <img> tags, only hyperlinks. However, you can embed images within the workbook like SpreadsheetAddImage does. As outlined in the POI's Busy Developers Guide, the basic process is:
Load the xlsx file with the WorkBookFactory
Grab the binary of each image and add it to the workbook
Anchor each image to the desired cells
Save the modified workbook to back to disk
Example:
<cfscript>
// ..
// load the xlsx file with the javaLoader
factory = loader.create("org.apache.poi.ss.usermodel.WorkbookFactory");
input = loader.create("java.io.FileInputStream").init( "c:/path/to/someFile.xlsx" );
workbook = factory.create( input );
input.close();
// get the desired sheet and load helper objects (once)
sheet = workbook.getSheet("Your Sheet Name");
patriarch = sheet.createDrawingPatriarch();
helper = workbook.getCreationHelper();
// add the image to the workbook
imageBytes = fileReadBinary( "c:/path/to/someImage.jpg" );
imageIndex = workbook.addPicture( imageBytes, workbook.PICTURE_TYPE_JPEG );
// anchor the picture to the first cell ie A1
anchor = helper.createClientAnchor();
anchor.setRow1( javacast("int", 0) ); // row of first cell (zero based)
anchor.setCol1( javacast("int", 0) ); // column of first cell (zero based)
picture = patriarch.createPicture( anchor, imageIndex );
picture.resize(); // only supported for jpg and png
// save it back to disk
outstream = loader.create("java.io.FileOutputStream").init( "c:/path/to/outFile.xlsx"" );
workbook.write( outstream );
outstream.flush();
outstream.close();
</cfscript>
New Columns
Ironically, inserting a new column is trickier than adding an image. Last I checked, POI still lacked a built in function for inserting new columns. So you would need to shift all existing cells to the right before inserting the images into the first column. The tricky part is maintaining cell formats, merged cells, etcetera.

image using .ashx

i am using .ashx to retrive image and i place the the image inside the ajax update panel it retrive the image when a new image is added to the form but when we change the image it is not updating the image it dont even call the .ashx file but when i refresh the browser it works properly
Sounds like a caching issue. Try adding some of the lines found here to your ashx file and it should hopefully force the browser to rerequest the image. (I know that the link is for ASP rather than ASP.NET, but things like Response.Expires = -1 should work)
Alternatively, can you change the path to the image in the updatepanel? If you just add a random parameter on to the end of it the browser will treat it as a fresh request (we use the current date/time as a parameter when we're doing this. The parameter is ignored by ASP.NET unless you explicitly reference it)
Do something like this:
var sPath = "../../handlers/ProcessSignature.ashx?type=View&UserID=" + userID + "&d=" + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
That puts a 4 character alpha numeric string at the end of your query string. It's not needed, but it will force browsers to pick up the latest version of that image because the URL is different.
I tried the above and some browsers ignore the headers. I threw all of those in and Chrome/FireFox 3 didn't try to update.
IE7 worked sometimes
IE6 just twiddled it's thumbs and asked why it was still in existence.
Changing the path above will fix it in all browsers.

Resources