Drupal - When I upload an image in drupal 8 the imagestyles are not shown for the first time

We had similar issue in our project might be same please check this link.

https://www.drupal.org/node/2195311


Without access to the environment, it's going to be near impossible to know what's going on.

Something between the upload AJAX request, the image form element render, and the image style request, is causing the upload/render process to break. With that known, you can try debugging through key parts of this process to determine where key assumptions break:

  1. file_managed_file_save_upload(): Is the file being saved correctly at this point? Is there anything in the about the file system/configuration that creates a duplicate file?
  2. ImageStyle::buildUrl(): After the file is saved and the form element is being rendered, is the style URL being generated correctly? Is the token correct? Is the file used the same as the one previously saved?
  3. ImageStyleDownloadController::deliver(): Upon browser update, is the image payload delivery working correctly? Is this code being triggered (e.g. not proxied through some CDN)? Can it access the same file that was previously saved?

You can use Devel functions (e.g. dpm(debug_backtrace())), standard PHP debugging functions (e.g. debug_print_backtrace()), or whatever else your favorite IDE might provide you (e.g. XDebug/DBGp integration) to inspect state during these key functions to get to the bottom of the problem.

Tags:

Media

8