Hello team,
I'm trying to translate my size : i added a custom size to the config thanks to the cljosse's work, with $new['d']['Optimal']=ImageStdParams::get_custom(900,9999);, but it's displayed as 'Optimal' despite my $lang['Optimal'] = 'Blbabla';
Then I saw :
{$derivative->get_type()|@translate}
which means with that custom size can't be translated currently right?
Offline
We never designed the multiple size engine so that someone can add custom sizes as "predefined" sizes.
There are multiple side effects to that under special circumstances and you'll get thing hard to debug (main things come from the fact that internally the defined type map assumes that multi szes are ordered in terms of dimensions; this constraint is enforced in the admin screen).
So I advise not to use it is way, but either use a predefined size or a truly custom size ...
Offline
Ok I see
So how could we add a kind of registered custom size : a custom size recognized by the system (cookie, menu etc) but not tweakable, like that not-recommended method do?
In parallel I will think of a workaround which could consist in restraining the "predefined" sizes.
ps : this would be for theme with sizes constrains
Offline
flop25 wrote:
So how could we add a kind of registered custom size : a custom size recognized by the system (cookie, menu etc) but not tweakable, like that not-recommended method do?
In parallel I will think of a workaround which could consist in restraining the "predefined" sizes.
This would come to allowing themes/plugins to define their own predefined derivative and drop the custom sizes as they are used today
flop25 wrote:
ps : this would be for theme with sizes constrains
Can you develop a bit ? What kind of constraint / where ?
Offline
rvelices wrote:
This would come to allowing themes/plugins to define their own predefined derivative and drop the custom sizes as they are used today
well that's so tricky that I've written/delete these next sentences almost three times. ^^
The default size are great for theme with no limitation, and downloading specific sizes
The current custom size is great for extensions who need to generate exotic sizes not so often
For custom size which comes as a standard for a extension, the extension needs to add this own admin page, but also needs to add its own entry on the batch manager : I have one theme and one plugin which generate custom sizes, and people asks for batch tasks. We could say 'okay it's to the creator to code this' and I agree. I'm just exposing the facts.
rvelices wrote:
Can you develop a bit ? What kind of constraint / where ?
this is when the problems come. For a theme like montblanc or the hr_* themes, the width is restricted. My goal was to add an full width size and let the user to chose smaller sizes. Currently montblanc use the 2small size, but it's arbitrary ; I can add a size with the method mentioned on the first post. This size stays during the browsing.
So the perfection would be to propose this optimal size as a maximum size and only smaller size. (Thinking about that, Stripped&Columns could use that kind of system -custom predefined sizes- on thumbnails)
And if you add to all of this, another layer by choosing a default size for each/major page/template (picture, thumbnail, comment...), it's mind-blowing!
And since I'm not programmer, it's even more mind-blowing for my little head.
Offline
flop25 wrote:
For custom size which comes as a standard for a extension, the extension needs to add this own admin page, but also needs to add its own entry on the batch manager : I have one theme and one plugin which generate custom sizes, and people asks for batch tasks. We could say 'okay it's to the creator to code this' and I agree. I'm just exposing the facts.
for the batch manager it is feasible (we already show all existing custom derivatives in the admin multi size screen with the ability to delete them)
flop25 wrote:
this is when the problems come. For a theme like montblanc or the hr_* themes, the width is restricted. My goal was to add an full width size and let the user to chose smaller sizes. Currently montblanc use the 2small size, but it's arbitrary ; I can add a size with the method mentioned on the first post. This size stays during the browsing.
So the perfection would be to propose this optimal size as a maximum size and only smaller size. (Thinking about that, Stripped&Columns could use that kind of system -custom predefined sizes- on thumbnails)
And if you add to all of this, another layer by choosing a default size for each/major page/template (picture, thumbnail, comment...), it's mind-blowing!
And since I'm not programmer, it's even more mind-blowing for my little head.
Yes it's a point of view, but isn't it also mind blowing if several themes/plugins add several predefined sizes to the existing nine ones ?
Also if you are width constraint in your theme, you can always automatically pick the largest size that has a width smaller than your limit. (render_picture_content stuff is not only for plugins, but also for themes ...)
Anyway, if you find a global solution, i'm fine with that, but it will not be easy to get rid of all the side effects and still have a reasonable performance ...
Offline