草庐IT

contact_image_data

全部标签

image - Golang 图像 iptc 元数据

我需要从服务器上上传的文件中获取元数据,尤其是iptc元数据。我找到了两个可以导入的包,但它们都需要“libiptcdata”库。这应该不是问题,但是在我用brew安装了libary之后,因为它写在两个包页面上,并输入goget“https://github.com/Melraidin/iptc”(例如,我想使用的两个包之一),我收到以下错误:../../github.com/Melraidin/iptc/main.go:10:10:fatalerror:libiptcdata/iptc-data.h:Nosuchfileordirectory#include^~~~~~~~~~~~~

image - qml qt grabToImage 获取图像字节

出于某种原因,直接从qml中保存png是行不通的。我在Golang应用程序之上有一个qmlUI。当我做的时候source.grabToImage(function(result){console.log("image:",result.url)if(!result.saveToFile(urlNoProtocol)){console.error('Unknownerrorsavingto',urlNoProtocol);}else{console.log("savedto"+urlNoProtocol)}保存时出错。保存文件的位置来自fileDialog,我对其进行预处理以删除file

arrays - GO 中的 : Parsing byte array of excel data using https://github. com/tealeg/xlsx 库

我想使用https://github.com/tealeg/xlsx解析excel数据的字节数组GOLANG中的库。实际上,我正在从请求(作为字节数组)获取数据到我的GRPC服务器,我必须在其中解析和处理它。我检查了库API,但它接受文件名作为参数。"github.com/tealeg/xlsx"funcmain(){xlsx.OpenFile("file.xslx")}知道如何直接传递字节数组并对其进行处理。 最佳答案 明白了。用过的funcOpenBinary(bs[]byte)(*文件,错误)

image - 如何在 Go 中发送带有图像和一些参数的 http post 请求?

我正在尝试使用表单数据中的图像和参数发出httppost请求,但是当我添加图像时,我的参数丢失了。testProduct:=&Product{Name:"TestProductName",ImageExtension:"png",}varbbytes.BuffermultipartWriter:=multipart.NewWriter(&b)multipartWriter.CreateFormFile("image","../test.png")multipartWriter.Close()form=url.Values{}form.Add("name",testProduct.Nam

data-structures - 在 Go 中存储和迭代命名嵌套数据结构的惯用方法?

我的问题分为两个:(1)为下面的taskList存储数据的最佳方式是什么,以及(2)迭代这种结构的最佳方式是什么?我想要命名task1因为它们是独特的任务并且不应该有ID冲突。我想要单独命名为subtask0,因为它们是具有不同要求的独特任务。下面是我意图的伪围棋表示:packagemainimport"fmt"fnmain(){consttaskList:={"task1":{"subtask0":"api.example.com/stuff/""subtask1":"api.example.com/stuff/""subtask2":"api.example.com/stuff/"

gorilla /mux : Image not displaying

我是Golang的新手。我需要显示图像。我尝试使用Gorilla/mux。但我仍然收到错误:404。我的事情可能是我使用mux代码的地方不正确。主要功能packagemainimport("net/http""mytestsite/handlers""log""github.com/gorilla/mux")funcmain(){r:=mux.NewRouter()r.HandleFunc("/register",handlers.RegisterHandler)r.HandleFunc("/sucess",handlers.Sucess)r.HandleFunc("/login",h

image - 通过 goRPC 发送和图像

我想使用golang数据包通过rpc发送图像valyalagoRPC我在服务器中接收图像类型时遇到了一些问题。这是我的客户端代码,它获取一张.jpg图像,对其进行解码并通过rpc发送:c:=&gorpc.Client{//TCPaddressoftheserver.Addr:"127.0.0.1:12345",}c.Start()reader,err:=os.Open("barranco.jpg")iferr!=nil{log.Fatal(err)}deferreader.Close()img,_,err:=image.Decode(reader)iferr!=nil{log.Fata

image - Go - 将 base64 字符串保存到文件

所以..我有一个base64编码的字符串,我需要对其进行解码,检查它的宽度和高度,然后保存到文件中。然而..我一直在保存损坏的图像文件。packageserverimport("encoding/base64""errors""io""os""strings""image"_"image/gif"_"image/jpeg"_"image/png")var(ErrBucket=errors.New("Invalidbucket!")ErrSize=errors.New("Invalidsize!")ErrInvalidImage=errors.New("Invalidimage!"))f

image-processing - 如何让 golang 读取 jpeg 并获得与 Python/C 相同的 unit8 值?

我有一个用于某些图像处理代码的测试jpeg&我正在尝试获取与python中的opencv和Python中的C和Pillow(通过scipy)相同的uint8值数组,它们都匹配这些值当我使用gimp打开jpeg时,我得到了。我尝试将颜色值移动8位,但这并不能准确地转换值-看起来有一些我不太明白的舍入。我知道gimp和opencv以及Pillow/scipy都使用libjpeg,所以我尝试使用https://github.com/pixiv/go-libjpeg并使用将图像转换为8位funcConvert(imgimage.Image)*image.RGBA{b:=img.Bounds()

golang 练习 :images missing at method

我正在完成练习:图片位于https://tour.golang.org/methods/25我遇到了一个问题。这是我的代码...packagemainimport("golang.org/x/tour/pic""image")typeImagestruct{image*image.RGBA}funcmain(){rect:=image.Rect(0,0,255,255)myImage:=image.NewRGBA(rect)m:=Image{myImage}pic.ShowImage(m)}它给了我错误...tmp/sandbox089594299/main.go:16:cannotu