View more context

 

sb

Thanks for your replies. Well we are already using imagick, otherwise some large images wouldn't work at all. It's a real problem if the process times out as imagick is not properly cleaning up temporary files… (and those temporary files seem to be uncompessed image files…)

Ed Linklater

there was an external service that someone was using at #stripeconeu - let me see if I can find it. seemed like a good option for people where SS' built-in functionality isn't enough

sb

Thanks 😉 We are looking for a self hosted solution. We have some sites using Thumbor (http://thumbor.org/) with rewriting image urls to point to the thumbor server. I was just wondering if someone has different approaches 🙂

Show 1 attachment(s)
thumbor - open-source smart on-demand image cropping, resizing and filters

Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. It features a very smart detection of important points in the image for better cropping and resizing, using state-of-the-art face and feature detection algorithms (more on that in Detection Algorithms).

Hide attachment content
Ed Linklater

The only thing I've done in the past was onAfterWrite on DataObjects that attach images, pre-generating the common sizes

Ed Linklater

you could potentially combine that approach with queuedjobs to run a queue that generates all the image sizes you use

Ed Linklater

that way you're not trying to generate too much within a single HTTP request

wmk

When I have a manymany relation and someone deletes the related DataObject, is it supposed to clean up the many_many relation table? Or do I need to remove the items from the ManMany relation manually?

wmk

but then it deletes the related items... In my case someone deleted on the belongs_manymany site; it didn't clean up; now if I add a new item and it accidently has an old ID it's automatically related to the old relations

Ed Linklater

a new object shouldn't get an old ID unless you've reset the auto_increment on the table

Ed Linklater

the DB maintains its own counter, it doesn't just take the highest ID and add 1 to it

Ed Linklater

(for MySQL/MariaDB anyway, I can't speak for other DBs)

wmk

seems it got an old ID after moving a DB to a new server (from test to live or so).

wmk

for the record: in delete(), $this->ManyManyRelation()->removeAll() cleans up the relation table when deleting.

Ed Linklater

ah - gotta make sure you include auto_increment value of tables in your SQL dump

wmk

dunno if sspak or phpmyadmin do that by default

Ed Linklater

the mysqldump command does it by default, which I think sspak uses

wmk

but theoretically a hook to loop over all manymany relations and cleans up would be an improvement, wouldn't it?

Ed Linklater

in other ORMs it would be natural, but it kinda goes against the "playing it safe" nature of the SS ORM in my opinion

wmk

for the record, here is an old issue about it: https://github.com/silverstripe/silverstripe-framework/issues/5290 manymany through with cascade deletes would be the way to go

Show 1 attachment(s)
GitHub  
Clean up DB deletion queries · Issue #5290 · silverstripe/silverstripe-framework

Quite some time ago there was some debate around cleaning-up intermediary relations when one or the other side of a ManyMany relation was deleted, for internal consistency. The arguments for this a...

Hide attachment content
Ed Linklater

yeah, I think using the cascade deletes feature is best because that way it is developer-specified and not "magic" data deletion that the developer doesn't know about


Show less replies