如何让Odoo 9使用S3存储桶来存储二进制文件?(How to make Odoo 9 use an S3 bucket to store binary files?)
我在EC2上运行了一个Odoo实例(版本9)。 Postgres数据库在RDS上运行,据我所知,二进制文件不存储在数据库中,而是存储在运行Web服务器的实例的文件系统中。
如何调整Odoo 9以便它使用S3存储桶进行文件存储(而不是文件系统)?
I've got an Odoo instance (version 9) running on EC2. The Postgres database runs on RDS and, as far as I understand, binary files are not stored in the db but rather on the file system of the instance running the web server.
How can I tweak Odoo 9 so that it uses an S3 bucket for files storage (instead of the file system)?
原文:https://stackoverflow.com/questions/38805733
最满意答案
根据您之前的问题,我假设图像视图是此自定义视图对象的子视图。 您需要在此类中维护可变数组的路径。 在
touchesBegan:withEvent:
初始化它,并关闭touchesEnded:withEvent:
的路径。 将路径推入阵列。 在每个触摸事件(开始,移动,结束)时,调用一个方法,在将触摸点添加到路径后更新图像视图的图像。更新图像将涉及创建空图像上下文,然后在触摸它们时迭代阵列中的所有路径和当前路径。 完成绘制后,从上下文生成图像对象并将其设置为图像。 在我们注意到每条路径的属性可能不同之前,我们会非常直截了当 要处理这个问题,你应该为路径创建一个容器类,它将保存路径的属性。 将此类的对象推送到数组中的每个路径而不是路径本身。 这样您就可以维护视图的状态。
Based on your earlier question, I am assuming that the image view is a subview of this custom view object. You will need to maintain a mutable array of paths in this class. Initialize it at
touchesBegan:withEvent:
and close the path attouchesEnded:withEvent:
. Push the path into the array. At every touch event (began, moved, ended), call a method that updates the image view's image after adding the touch point to the path.Updating the image will involve creating an empty image context and then iterating over all paths in your array and the current path while stroking them. Once you're done drawing, generate the image object from the context and set it to the image. Pretty straightforward until we notice that each path might differ in attributes. To deal with this you should create a container class for the path which will hold the attributes about the path. Push an object of this class for every path into the array rather than the path itself. This way you can maintain state for your view.
相关问答
更多-
如何用png-brush和UIBezierPath擦除一块UIImageView(How to erase piece of UIImageView with png-brush and UIBezierPath)[2022-04-11]
有一个开源项目,这对你很有用。iOS-Scratch-n-See 。 ImageMaskView类将是有趣的研究。 希望有所帮助! There is an open source project which will be useful for you .. iOS-Scratch-n-See. Class ImageMaskView will be interesting to study. Hope that helps! -
如果要将图像发送到服务器。 发送它的唯一方法是将UIImage转换为NSData 。 NSData *imageData= UIImageJPEGRepresentation(image,0.0); NSData *imageData = UIImagePNGRepresentation(image); If you want to send image to server. The only way to send it is by converting the UIImage to NSData . ...
-
将照片保存到UIImageView(Save photo to UIImageView)[2022-01-25]
在我看来,你没有为图像选择器设置委托,例如: [imagePickerController setDelegate:self]; 我想那将是你的takePicture方法。 It seems to me that you're not setting the delegate for the image picker, For instance: [imagePickerController setDelegate:self]; I think that would be in your takePictu ... -
如何将UIBezierPath保存到现有的UIImageView?(How to save a UIBezierPath to an existing UIImageView?)[2022-07-15]
根据您之前的问题,我假设图像视图是此自定义视图对象的子视图。 您需要在此类中维护可变数组的路径。 在touchesBegan:withEvent:初始化它,并关闭touchesEnded:withEvent:的路径。 将路径推入阵列。 在每个触摸事件(开始,移动,结束)时,调用一个方法,在将触摸点添加到路径后更新图像视图的图像。 更新图像将涉及创建空图像上下文,然后在触摸它们时迭代阵列中的所有路径和当前路径。 完成绘制后,从上下文生成图像对象并将其设置为图像。 在我们注意到每条路径的属性可能不同之前,我们会 ... -
为了得到一个真实的,完全充实的答案,这里基本上是你需要的。 let consume = 0.25 let x = self.frame.size.width / 2.0 let y = self.frame.size.height / 2.0 let radius = (frame.size.width - 10) / 2.0 let startAngle: CGFloat = CGFloat(M_PI * (-1/2)) let endAngle = CGFloat(M_PI * 2 - M_PI/2 * ...
-
你做的工作超出了你的需要。 在调用UIGraphicsBeginImageContextWithOptions()之前调用[path addClip]会导致“无效上下文”消息。 UIBezierPath尝试访问线程的当前图形上下文,但尚未设置。 这是获得相同结果的更简单方法。 请注意,您根本不需要使用CGContext 。 UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0); UIBezierPath *path = [UIBezierPa ...
-
CGContextSetFillColorWithColor:无效的上下文0x0。 这意味着您在没有有效绘图上下文的情况下尝试进行核心图形绘制操作。 0x0是nil 。 每当您尝试在没有当前图形上下文时填充或描边路径时,您将获得此输出。 你自己制作一个当前的图形上下文,它可以用于在屏幕外绘制图像,或者当UIKit创建一个时,它会在它调用draw(_ rect:)之前完成draw(_ rect:) 你setProgress()在draw(_ rect:)调用setProgress() ,在这种情况下你的绘图会 ...
-
来自图像的UIBezierPath(UIBezierPath from image)[2023-10-30]
我走了一个不同的方向。 我没有使用PNG,而是使用SVG并使用PocketSVG来解析文件。 它很棒。 I went a different direction. Instead of using PNGs I went with SVG and used PocketSVG to parse the file. It works great. -
UIBezierPath不同的颜色(UIBezierPath different colors)[2023-05-13]
我发现了一个演示代码.. 请检查一下它是否对您有所帮助.. 平滑线链接 I found one demo code for that.. Please check this if it will be helpful to you.. Smooth Line link -
您在转换之前绘制路径(使用stroke )。 路径只是一种数学表示。 这不是“在屏幕上”的界限。 您无法通过修改有关它的数据来移动您已绘制的内容。 只需将[aPath stroke]移出pathFrom:to:并将其放在applyTransform: 。 You're drawing the path (with stroke) before you transform it. A path is just a mathematical representation. It isn't the line " ...