Empty image width, height, size, type after uSync...
# help-with-umbraco
u
This is my first project with Umbraco and uSync (free version). I just ran a uSync import in our staging site, and all the imported images were missing their width, height, size, and type information. I realized I forgot to move the media files into the Azure blob container before running the uSync import (that's the correct flow right? move the media and then run the uSync import?). So I moved the media files into the staging container and then ran the uSync import again. While I can now see the images in the Media area, they are still missing their width, height, size, and type information. How can I get this image information to show up?
k
Hi, if the media isn;t on disk then the width/height etc are not set on the media object, those properties are actually calculated dependent on the media. so you copy the media folder first and then run the import all those values should get filled in.
you might have to 'force' the import if you've done it once before.
u
Thank you Kevin. That makes sense. How do you "force" the import?
@Kevin Jump Sorry to bug, but how do you "force" the import if the import was run before the media folder was moved?
k
that should update all the media items
p
@Kevin Jump I am currently working on a migration project that has media in the 10's of GB's which I don't want locally and so what I had to do was grab the source for the uSync.Migration project and comment out the following in
MediaMigrationHandler.cs
before running my migrations:
Copy code
_ignoredProperties.UnionWith(new[]
    {
        UmbConstants.Conventions.Media.Bytes,
        UmbConstants.Conventions.Media.Extension,
        UmbConstants.Conventions.Media.Height,
        UmbConstants.Conventions.Media.Width,
    });
It imported without the media being on disk so I assumed that was because uSync would import it if it was in the uSync files even if the files were not on disk?
k
hi, yeah uSync will import the media 'config' files from the uSync/x/media folder, even if the physical media isn't on disk, those fields are automatically set by umbraco when a media item is saved, so while they can be put in the uSync files, and uSync can in theory set them, if there is a file on disk they are immeditly overwritten by the Umbraco save process for media.
33 Views