Vuffy wrote:Sorry to bump an old thread, but the solution in this thread might be relevant in my situation.
Adam,
Would your code change help us if say our store setting is set to store images in DB. If we change it to File system, images won't be broken and we won't need to re-upload all product photos again into file?
3.8
Thanks
Yep, the reason it's failing is shown in the code snippet I posted. PictureBinary will be NULL unless StoreInDb is enabled. As you can see, if PictureBinary is NULL, the "default picture url" is returned.
Example flow (based on naming convention) might look like:
check if proper file exists:
{PictureId}_{thumbSize}.png
Doesn't exist? Find original (created on upload)
{PictureId}.png
Resize and create new image on file system called:
{PictureId}_{thumbSize}.png
Hope that helps!