KarlvonKarton Posted June 10, 2019 Share Posted June 10, 2019 Is it true that when you add an image to the images field, that the image will be uploaded without taking the settings of that field into account? So if I set the input of the images field to max width: 3000px, then an image of 6000px width will stay that size after adding it with the API? Link to comment Share on other sites More sharing options...
dotnetic Posted June 10, 2019 Share Posted June 10, 2019 What exactly do you mean with adding it with the API? Do you mean a file upload? Do you mean output? I think you are mixing input/upload and output here?! Link to comment Share on other sites More sharing options...
KarlvonKarton Posted June 10, 2019 Author Share Posted June 10, 2019 $page->images->add($imgurl); So my question is: When I add an image like above, why this image is not resized to my setting in the field (set in admin). Link to comment Share on other sites More sharing options...
Robin S Posted June 10, 2019 Share Posted June 10, 2019 5 hours ago, KarlvonKarton said: Is it true that when you add an image to the images field, that the image will be uploaded without taking the settings of that field into account? Yes, it is true, because all of those settings are handled by the image inputfield and when you add an image via the API the inputfield is not involved. So you have to do you own checks, resizing, etc. For some starting code take a look at my AddImageUrls module: https://github.com/Toutouwai/AddImageUrls/blob/bed9f2a910c3b120756e35e84ff734f345160bfa/AddImageUrls.module#L119-L171 2 Link to comment Share on other sites More sharing options...
KarlvonKarton Posted June 11, 2019 Author Share Posted June 11, 2019 Thank you, Robin. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now